[NFC][RemoveDIs] Prefer iterators over inst-pointers in InstCombine
[llvm-project.git] / llvm / test / CodeGen / AArch64 / bti-branch-relaxation.ll
blobd9ed54fb86bf151d60c376c0faeb7c08b7c7ce4c
1 ; RUN: llc %s -o - | FileCheck %s
2 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
3 target triple = "aarch64"
5 ; Function Attrs: nounwind
6 define dso_local void @f(i64 %v) local_unnamed_addr #0 {
7 entry:
8   %call = tail call i32 @test() #0
9   %and = and i32 %call, 2
10   %cmp = icmp eq i32 %and, 0
11   br i1 %cmp, label %if.then, label %if.else
12 ; CHECK: tbz
13 ; CHECK-NEXT: b
14 if.then:                                          ; preds = %entry
15   switch i64 %v, label %sw.epilog [
16     i64 0, label %sw.bb
17     i64 1, label %sw.bb1
18     i64 2, label %sw.bb2
19     i64 3, label %sw.bb3
20   ]
22 sw.bb:                                            ; preds = %if.then
23   tail call void @g0() #0
24   br label %sw.bb1
26 sw.bb1:                                           ; preds = %if.then, %sw.bb
27   tail call void @g1() #0
28   br label %sw.bb2
30 sw.bb2:                                           ; preds = %if.then, %sw.bb1
31   tail call void @g2() #0
32   br label %sw.bb3
34 sw.bb3:                                           ; preds = %if.then, %sw.bb2
35   tail call void @g3() #0
36   br label %sw.epilog
38 sw.epilog:                                        ; preds = %sw.bb3, %if.then
39   %dummy = tail call i64 @llvm.aarch64.space(i32 32700, i64 %v)
40   br label %if.end
42 if.else:                                          ; preds = %entry
43   tail call void @e() #0
44   br label %if.end
46 if.end:                                           ; preds = %if.else, %sw.epilog
47   ret void
50 declare dso_local i32 @test(...) local_unnamed_addr #0
52 declare dso_local void @g0(...) local_unnamed_addr #0
54 declare dso_local void @g1(...) local_unnamed_addr #0
56 declare dso_local void @g2(...) local_unnamed_addr #0
58 declare dso_local void @g3(...) local_unnamed_addr #0
60 declare dso_local void @e(...) local_unnamed_addr #0
62 declare dso_local i64 @llvm.aarch64.space(i32, i64) local_unnamed_addr #0
64 attributes #0 = { nounwind "branch-target-enforcement"="true" "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+neon,+v8.5a" "unsafe-fp-math"="false" "use-soft-float"="false" }