You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is similar to the tighten pass, but instead of operating on values, it should operate on subsections of the CFG. Similar to the tighten pass, it should avoid moving work into a loop.
The compiled code for
f
matches the input closely: It checksx < 0
, negates it if so, then checks b.But we only need to check and modify x if b is true. The compiler should rewrite this code into:
This is similar to the tighten pass, but instead of operating on values, it should operate on subsections of the CFG. Similar to the tighten pass, it should avoid moving work into a loop.
Among other things, this would help avoid doing needless work when the return value of copy is unused; see https://go-review.googlesource.com/c/go/+/94596.
Marking 1.11 optimistically, although I have no plans to work on this myself.
cc @randall77 @dr2chase @cherrymui
The text was updated successfully, but these errors were encountered: