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
right now we generate this code for a write barrier test:
MOVL runtime.writeBarrier(SB), AX
TESTB AL, AL
JNE ...
We should really do:
CMPB $1, runtime.writeBarrier(SB)
JEQ ...
One less instruction, no register required.
It's not easy to do now because flagalloc doesn't like operations that take a memory input and generate a flag output (because it wants to be able to move the flag-generation instructions around).
Figure out a way to fix this. Maybe introduce a new block type BlockWBCheck that takes a memory control value and has 2 successors. It has the CMPx implicit inside it. It would need to be marked as clobbering flags.
If the only use of a load is a CMP with const,
I think we could combine the load and CMP
into CMP $const, MEM.
Actually, this transform should be generic
for x86 and not necessarily limited to CMP.
I think having a package global bool that
is queried often is a pretty common scenario.
(it probably also makes sense to align such
variable to cache line size, so that there is
no false sharing.)
right now we generate this code for a write barrier test:
We should really do:
One less instruction, no register required.
It's not easy to do now because flagalloc doesn't like operations that take a memory input and generate a flag output (because it wants to be able to move the flag-generation instructions around).
Figure out a way to fix this. Maybe introduce a new block type BlockWBCheck that takes a memory control value and has 2 successors. It has the CMPx implicit inside it. It would need to be marked as clobbering flags.
@drchase
The text was updated successfully, but these errors were encountered: