This changes a couple of calls to LiveRegs.contains to !LiveRegs.available, one in Thumb1FrameLoweringInfo (which modifies a test to look more correct to me, given r7 should be the frame pointer so is not available), and another in the ARMLoadStoreOptimizer, that I don't have a test for, it was just found by inspection.
Details
Diff Detail
Event Timeline
llvm/lib/Target/ARM/Thumb1FrameLowering.cpp | ||
---|---|---|
588 | I have not looked very long at this (and the context how this is used), but if we want to find an available temporary, then the check: "the live physical registers UsedRegs does not contain Reg" sounds about right to me. So can you perhaps explain the problem and why this is wrong? |
llvm/lib/Target/ARM/Thumb1FrameLowering.cpp | ||
---|---|---|
588 | The docs of contains() say it all: /// Note: Returns false if just some sub registers are live, use available() /// when searching a free register. available() will also check for reserved regs, like r7 under the thumb1 test. The reason I was looking at this was because of the subreg liveness. RDA needed a number of fixes to make it correct. This case possibly does not matter as much, with GPR regs not having subregs, but available() seems like the more correct function to use. |
llvm/lib/Target/ARM/Thumb1FrameLowering.cpp | ||
---|---|---|
588 | Ah, thanks, makes sense! Looks like a good fix to me! |
I have not looked very long at this (and the context how this is used), but if we want to find an available temporary, then the check:
sounds about right to me.
So can you perhaps explain the problem and why this is wrong?