summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/2011-04-15-RegisterCmpPeephole.ll
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-04-15 21:24:38 +0000
committerCameron Zwarich <zwarich@apple.com>2011-04-15 21:24:38 +0000
commit0cb11ac32fc09c5db42fb801db242ac9fb51f6b1 (patch)
tree9ab277597e35edd12827665a3179cdd1b21e595f /test/CodeGen/ARM/2011-04-15-RegisterCmpPeephole.ll
parent3e03e5d2a95670efec327550d15895c25e7fc43b (diff)
downloadllvm-0cb11ac32fc09c5db42fb801db242ac9fb51f6b1.tar.gz
llvm-0cb11ac32fc09c5db42fb801db242ac9fb51f6b1.tar.bz2
llvm-0cb11ac32fc09c5db42fb801db242ac9fb51f6b1.tar.xz
Add ORR and EOR to the CMP peephole optimizer. It's hard to get isel to generate
a case involving EOR, so I only added a test for ORR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/2011-04-15-RegisterCmpPeephole.ll')
-rw-r--r--test/CodeGen/ARM/2011-04-15-RegisterCmpPeephole.ll25
1 files changed, 22 insertions, 3 deletions
diff --git a/test/CodeGen/ARM/2011-04-15-RegisterCmpPeephole.ll b/test/CodeGen/ARM/2011-04-15-RegisterCmpPeephole.ll
index a98d3f6ba9..5404cf57a5 100644
--- a/test/CodeGen/ARM/2011-04-15-RegisterCmpPeephole.ll
+++ b/test/CodeGen/ARM/2011-04-15-RegisterCmpPeephole.ll
@@ -3,7 +3,7 @@
; CHECK: _f
; CHECK: adds
; CHECK-NOT: cmp
-; CHECK: blxeq _g
+; CHECK: blxeq _h
define i32 @f(i32 %a, i32 %b) nounwind ssp {
entry:
@@ -12,11 +12,30 @@ entry:
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
- tail call void (...)* @g(i32 %a, i32 %b) nounwind
+ tail call void (...)* @h(i32 %a, i32 %b) nounwind
br label %if.end
if.end: ; preds = %if.then, %entry
ret i32 %add
}
-declare void @g(...)
+; CHECK: _g
+; CHECK: orrs
+; CHECK-NOT: cmp
+; CHECK: blxeq _h
+
+define i32 @g(i32 %a, i32 %b) nounwind ssp {
+entry:
+ %add = or i32 %b, %a
+ %cmp = icmp eq i32 %add, 0
+ br i1 %cmp, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ tail call void (...)* @h(i32 %a, i32 %b) nounwind
+ br label %if.end
+
+if.end: ; preds = %if.then, %entry
+ ret i32 %add
+}
+
+declare void @h(...)