summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2011-04-19 18:11:49 +0000
committerBob Wilson <bob.wilson@apple.com>2011-04-19 18:11:49 +0000
commit5dde893c2bac9e1569c38429f756c1d723e8edf2 (patch)
treec50cc65135cde589cb7ccb40f829b18e1c9b3454 /test
parentf6a4d3c2f3e1029af252a0f6999edfa3c2f326ee (diff)
downloadllvm-5dde893c2bac9e1569c38429f756c1d723e8edf2.tar.gz
llvm-5dde893c2bac9e1569c38429f756c1d723e8edf2.tar.bz2
llvm-5dde893c2bac9e1569c38429f756c1d723e8edf2.tar.xz
Avoid some 's' 16-bit instruction which partially update CPSR
(and add false dependency) when it isn't dependent on last CPSR defining instruction. rdar://8928208 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129773 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/ARM/avoid-cpsr-rmw.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/avoid-cpsr-rmw.ll b/test/CodeGen/ARM/avoid-cpsr-rmw.ll
new file mode 100644
index 0000000000..d0c4f3ae9d
--- /dev/null
+++ b/test/CodeGen/ARM/avoid-cpsr-rmw.ll
@@ -0,0 +1,16 @@
+; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a9 | FileCheck %s
+; Avoid some 's' 16-bit instruction which partially update CPSR (and add false
+; dependency) when it isn't dependent on last CPSR defining instruction.
+; rdar://8928208
+
+define i32 @t(i32 %a, i32 %b, i32 %c, i32 %d) nounwind readnone {
+ entry:
+; CHECK: t:
+; CHECK: muls r2, r3, r2
+; CHECK-NEXT: mul r0, r0, r1
+; CHECK-NEXT: muls r0, r2, r0
+ %0 = mul nsw i32 %a, %b
+ %1 = mul nsw i32 %c, %d
+ %2 = mul nsw i32 %0, %1
+ ret i32 %2
+}