[PATCH] D31815: [Thumb1] The recently added tADCS and tSBCS pseudo-instructions were missing `Uses = [CPSR]`
A. Skrobov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 10 11:05:54 PDT 2017
tyomitch created this revision.
Herald added a subscriber: rengolin.
Thanks to Oliver Stannard for helping catch this.
https://reviews.llvm.org/D31815
Files:
lib/Target/ARM/ARMInstrThumb.td
test/CodeGen/Thumb/long.ll
Index: test/CodeGen/Thumb/long.ll
===================================================================
--- test/CodeGen/Thumb/long.ll
+++ test/CodeGen/Thumb/long.ll
@@ -206,3 +206,31 @@
; CHECK: adds r0, r0, r2
; CHECK: sbcs r1, r3
}
+
+declare void @f13(i64 %x)
+
+define void @f14(i1 %x) #0 {
+; CHECK-LABEL: f14:
+entry:
+ call void @f13(i64 -3)
+; CHECK: bl
+ br i1 %x, label %if.end, label %if.then
+
+if.then:
+ call void @f13(i64 -50)
+; CHECK: bl
+ br label %if.end
+
+if.end:
+ call void @f13(i64 -5)
+; CHECK: adds
+; CHECK: adcs
+; CHECK: bl
+ call void @f13(i64 -3)
+; CHECK: adds
+; CHECK: adcs
+; CHECK: bl
+ ret void
+}
+
+attributes #0 = { optsize }
Index: lib/Target/ARM/ARMInstrThumb.td
===================================================================
--- lib/Target/ARM/ARMInstrThumb.td
+++ lib/Target/ARM/ARMInstrThumb.td
@@ -953,7 +953,7 @@
/// These opcodes will be converted to the real non-S opcodes by
/// AdjustInstrPostInstrSelection after giving then an optional CPSR operand.
let hasPostISelHook = 1, Defs = [CPSR] in {
- let isCommutable = 1 in
+ let isCommutable = 1, Uses = [CPSR] in
def tADCS : tPseudoInst<(outs tGPR:$Rdn), (ins tGPR:$Rn, tGPR:$Rm),
2, IIC_iALUr,
[(set tGPR:$Rdn, CPSR, (ARMadde tGPR:$Rn, tGPR:$Rm,
@@ -1292,6 +1292,7 @@
/// These opcodes will be converted to the real non-S opcodes by
/// AdjustInstrPostInstrSelection after giving then an optional CPSR operand.
let hasPostISelHook = 1, Defs = [CPSR] in {
+ let Uses = [CPSR] in
def tSBCS : tPseudoInst<(outs tGPR:$Rdn), (ins tGPR:$Rn, tGPR:$Rm),
2, IIC_iALUr,
[(set tGPR:$Rdn, CPSR, (ARMsube tGPR:$Rn, tGPR:$Rm,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31815.94540.patch
Type: text/x-patch
Size: 1767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170410/9b40cd01/attachment.bin>
More information about the llvm-commits
mailing list