This is preferred because it does not rely on accurate kill flags.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
The lit test shows increased spilling/reloading of scavenged registers. Previously it was:
spill r4 use r4 spill r5 use r4 and r5 use r5 reload r4 reload r5
Now it is:
spill r0 use r0 reload r0 spill r1 spill r2 use r1 and r2 reload r2 reload r1 spill r2 use r2 reload r2
@fhahn this is because RegScavenger::findSurvivorReg[forwards] returns with a "restore point" as late as possible, but findSurvivorBackwards does not return with a "spill before" point as early as possible. It only chooses the earlier To and the earliest vreg operand it saw.
I assume the special handling of vreg operands is because it was designed to be used for PrologEpilogInserter::doScavengeFrameVirtualRegs (D21885). Now that it is being used for frame index elimination too, would it make sense to handle frame index operands similarly?