• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
2; If-conversion defeats the purpose of this test, which is to check CBZ
3; generation, so use memory barrier instruction to make sure it doesn't
4; happen and we get actual branches.
5
6define i32 @t1(i32 %a, i32 %b, i32 %c) {
7; CHECK: t1:
8; CHECK: cbz
9	%tmp2 = icmp eq i32 %a, 0
10	br i1 %tmp2, label %cond_false, label %cond_true
11
12cond_true:
13        call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
14	%tmp5 = add i32 %b, 1
15        %tmp6 = and i32 %tmp5, %c
16	ret i32 %tmp6
17
18cond_false:
19        call void @llvm.memory.barrier(i1 true, i1 true, i1 true, i1 true, i1 false)
20	%tmp7 = add i32 %b, -1
21        %tmp8 = xor i32 %tmp7, %c
22	ret i32 %tmp8
23}
24
25declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind
26