[llvm] r178845 - Fix bug in PEI's virtual-register scavenging

Krzysztof Parzyszek kparzysz at codeaurora.org
Fri Apr 5 12:35:06 PDT 2013


On 4/5/2013 2:09 PM, Hal Finkel wrote:
>
> I think that it is better to keep the RS as consistent as possible. If we ever remove the FIXME in RS and it starts verifying defs as well, this way it won't blow up.

I don't think there is anything inconsistent with my approach.  Here's 
my logic:

By the time when we do the scavenging, the RS would have scanned the 
instruction (so the physical register operands would have been 
recorded).  The def (or a virtual register) would be skipped at that 
time.  In the generated spill code, the use of the scavenged register 
would be marked as a kill, and so the newly substituted def would be 
consistent with the liveness information.  The PEI code would then mark 
the register as used (as it does now[1]).  These two steps would 
evaluate to a no-op from the RS's perspective, so it should be safe to 
simply reset the RS to the next instruction.

[1] The "RS->setUsed(ScratchReg)" should be guarded by "if (!MO.isDead())".

-Krzysztof

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation



More information about the llvm-commits mailing list