Thanks to Oliver Stannard for helping catch this.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
test/CodeGen/Thumb/long.ll | ||
---|---|---|
234 ↗ | (On Diff #94540) | Please write an MIR testcase; it's difficult to understand what this is testing. |
test/CodeGen/Thumb/long.ll | ||
---|---|---|
234 ↗ | (On Diff #94540) | The issue in this case was that the missing implicit-use of CPSR on tADCS led to the last tADDi8 being treated as dead, and eliminated (apparently by TwoAddressInstructionPass). The pass itself was doing everything right, it's just that its input was wrong. I'm not sure what kind of MIR would make this test case easier to understand. |
test/CodeGen/Thumb/long.ll | ||
---|---|---|
234 ↗ | (On Diff #94540) | For someone reading it, it isn't obvious why we're generating adcs in the first place (and if we improve constant hoisting at some point to split 64-bit constants, the adcs will go away). So I'd prefer an MIR test checking that TwoAddressInstructionPass or whatever isn't eliminating the tADDi8. If you'd prefer to stick with an IR test, please change it so it doesn't depend on constant hoisting. |
Sorry for the long delay! Test case updated to make the long adds explicit, and not depend on constant hoisting.
LGTM, with one minor comment.
test/CodeGen/Thumb/long.ll | ||
---|---|---|
229 ↗ | (On Diff #95989) | "; CHECK-NEXT: adcs", so nothing slips between. |
test/CodeGen/Thumb/long.ll | ||
---|---|---|
229 ↗ | (On Diff #95989) | There's actually push {r4}; pop {r1} between these two; but the other two aren't separated, so I'll change the other CHECK: adcs to CHECK-NEXT. |