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
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env)?
What did you do?
Inspected generated code after CL #531425 to verify expected improvements. The purpose of this change was to avoid ANDCCconst if possible, which removed an instruction that set the flag unnecessarily.
What did you expect to see?
Same or better code than before my change.
What did you see instead?
I noticed that for some functions the NilCheck wasn't optimized, whereas before my change it was. When looking at the GOSSAFUNC output with this change, tighten was able to move a load into a different (successor) block but left the associated NilCheck in the original block. The later NilCheck elimination pass only eliminates the NilCheck if is in the same block as the load or store that uses the NilCheck address.
An example of this is found in internal/abi.(*Name).IsBlank.
Even though I discovered this difference after my change for PPC64, it seems like this is a general problem in tighten if loads or stores are moved to a different block when they had related NilChecks in their original block because then the NilChecks can't be optimized.
The text was updated successfully, but these errors were encountered:
The problem can happen on x86 which should not be affected by CL #531435 (I gave the wrong number above). I see it happens in internal/abi.Name.IsBlank and other internal/abi.Name functions on x86.
If a block contains Nilcheck and Load, and the Load is moved into another block by tighten but leaves the Nilcheck behind, then it can't be eliminated. My change just allowed it to happen in more cases on PPC64 where it was already happening on x86.