summaryrefslogtreecommitdiff
path: root/test/CodeGen/Thumb2/thumb2-branch.ll
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-07-12 16:06:01 +0000
committerJim Grosbach <grosbach@apple.com>2011-07-12 16:06:01 +0000
commit92bf81ddd06b6ed16069fb1bf7f10a14508344d9 (patch)
tree64e01c3d96b29bbd259b3a47b1d2afc21c5284d6 /test/CodeGen/Thumb2/thumb2-branch.ll
parentc0f33cb59006d42d9d37b02a9158e1a370fc246b (diff)
downloadllvm-92bf81ddd06b6ed16069fb1bf7f10a14508344d9.tar.gz
llvm-92bf81ddd06b6ed16069fb1bf7f10a14508344d9.tar.bz2
llvm-92bf81ddd06b6ed16069fb1bf7f10a14508344d9.tar.xz
Improve test cases from r134746.
Use memory barriers to force if-conversion off for these tests instead of the internal llc command line option ifcvt-limit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134986 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb2/thumb2-branch.ll')
-rw-r--r--test/CodeGen/Thumb2/thumb2-branch.ll15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-branch.ll b/test/CodeGen/Thumb2/thumb2-branch.ll
index 9c6f68b343..4d9eda062f 100644
--- a/test/CodeGen/Thumb2/thumb2-branch.ll
+++ b/test/CodeGen/Thumb2/thumb2-branch.ll
@@ -1,6 +1,7 @@
-; RUN: llc < %s -ifcvt-limit=0 -mtriple=thumbv7-apple-darwin -mattr=+thumb2 | FileCheck %s
+; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mattr=+thumb2 | FileCheck %s
; If-conversion defeats the purpose of this test, which is to check conditional
-; branch generation, so turn it off.
+; branch generation, so use memory barrier instruction to make sure it doesn't
+; happen and we get actual branches.
define i32 @f1(i32 %a, i32 %b, i32* %v) {
entry:
@@ -10,10 +11,12 @@ entry:
br i1 %tmp, label %cond_true, label %return
cond_true: ; preds = %entry
+ call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
store i32 0, i32* %v
ret i32 0
return: ; preds = %entry
+ call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
ret i32 1
}
@@ -25,10 +28,12 @@ entry:
br i1 %tmp, label %cond_true, label %return
cond_true: ; preds = %entry
+ call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
store i32 0, i32* %v
ret i32 0
return: ; preds = %entry
+ call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
ret i32 1
}
@@ -40,10 +45,12 @@ entry:
br i1 %tmp, label %cond_true, label %return
cond_true: ; preds = %entry
+ call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
store i32 0, i32* %v
ret i32 0
return: ; preds = %entry
+ call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
ret i32 1
}
@@ -55,9 +62,13 @@ entry:
br i1 %tmp, label %return, label %cond_true
cond_true: ; preds = %entry
+ call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
store i32 0, i32* %v
ret i32 0
return: ; preds = %entry
+ call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
ret i32 1
}
+
+declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind