[PATCH] D135693: [WIP][RegisterScavenger][RISCV] Don't search for FrameSetup instrs if we were searching from Non-FrameSetup instrs
luxufan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 11 18:52:01 PDT 2022
StephenFan added a comment.
In D135693#3850538 <https://reviews.llvm.org/D135693#3850538>, @craig.topper wrote:
> In D135693#3850055 <https://reviews.llvm.org/D135693#3850055>, @craig.topper wrote:
>
>> If I understand correctly, the use of a vreg in the frame-setup allowed findSurvivorBackward to trigger this code
>>
>> // Keep searching when we find a vreg since the spilled register will
>> // be usefull for this other vreg as well later.
>> bool FoundVReg = false;
>> for (const MachineOperand &MO : MI.operands()) {
>> if (MO.isReg() && Register::isVirtualRegister(MO.getReg())) {
>> FoundVReg = true;
>> break;
>> }
>> }
>> if (FoundVReg) {
>> InstrCountDown = InstrLimit;
>> Pos = I;
>> }
>>
>> which caused the search to stop above the frame-setup. So another option might be to use T1 as the scratch register in frame-setup as was once proposed in an earlier revision of https://reviews.llvm.org/D61884
>
> But we can't use T1 with shrink wrapping and I've confirmed the same bug exists with shrink wrapping.
Thanks for looking into shrink-wrapping! Do you mind sharing your shrink-wrapping test cases? So that I can pick them as CodeGen/RISCV test cases.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135693/new/
https://reviews.llvm.org/D135693
More information about the llvm-commits
mailing list