aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Thumb2/thumb2-bcc.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-bcc.ll
parentc0f33cb59006d42d9d37b02a9158e1a370fc246b (diff)
downloadexternal_llvm-92bf81ddd06b6ed16069fb1bf7f10a14508344d9.zip
external_llvm-92bf81ddd06b6ed16069fb1bf7f10a14508344d9.tar.gz
external_llvm-92bf81ddd06b6ed16069fb1bf7f10a14508344d9.tar.bz2
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-bcc.ll')
-rw-r--r--test/CodeGen/Thumb2/thumb2-bcc.ll11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-bcc.ll b/test/CodeGen/Thumb2/thumb2-bcc.ll
index 5e07b7c..70febc0 100644
--- a/test/CodeGen/Thumb2/thumb2-bcc.ll
+++ b/test/CodeGen/Thumb2/thumb2-bcc.ll
@@ -1,7 +1,8 @@
-; RUN: llc < %s -ifcvt-limit=0 -march=thumb -mattr=+thumb2 | FileCheck %s
-; RUN: llc < %s -ifcvt-limit=0 -march=thumb -mattr=+thumb2 | not grep it
+; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
+; RUN: llc < %s -march=thumb -mattr=+thumb2 | not grep it
; If-conversion defeats the purpose of this test, which is to check CBZ
-; generation, so turn it off.
+; generation, so use memory barrier instruction to make sure it doesn't
+; happen and we get actual branches.
define i32 @t1(i32 %a, i32 %b, i32 %c) {
; CHECK: t1:
@@ -10,12 +11,16 @@ define i32 @t1(i32 %a, i32 %b, i32 %c) {
br i1 %tmp2, label %cond_false, label %cond_true
cond_true:
+ call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
%tmp5 = add i32 %b, 1
%tmp6 = and i32 %tmp5, %c
ret i32 %tmp6
cond_false:
+ call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
%tmp7 = add i32 %b, -1
%tmp8 = xor i32 %tmp7, %c
ret i32 %tmp8
}
+
+declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind