[PATCH] D31815: [Thumb1] The recently added tADCS and tSBCS pseudo-instructions were missing `Uses = [CPSR]`

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 11:21:37 PDT 2017


efriedma added inline comments.


================
Comment at: test/CodeGen/Thumb/long.ll:234
+  ret void
+}
+
----------------
tyomitch wrote:
> efriedma wrote:
> > Please write an MIR testcase; it's difficult to understand what this is testing.
> 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.
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.


https://reviews.llvm.org/D31815





More information about the llvm-commits mailing list