File: bti-branch-relaxation.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (64 lines) | stat: -rw-r--r-- 2,582 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
; RUN: llc %s -o - | FileCheck %s
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-unknown-eabi"

; Function Attrs: nounwind
define dso_local void @f(i64 %v) local_unnamed_addr #0 {
entry:
  %call = tail call i32 bitcast (i32 (...)* @test to i32 ()*)() #0
  %and = and i32 %call, 2
  %cmp = icmp eq i32 %and, 0
  br i1 %cmp, label %if.then, label %if.else
; CHECK: tbz
; CHECK-NEXT: b
if.then:                                          ; preds = %entry
  switch i64 %v, label %sw.epilog [
    i64 0, label %sw.bb
    i64 1, label %sw.bb1
    i64 2, label %sw.bb2
    i64 3, label %sw.bb3
  ]

sw.bb:                                            ; preds = %if.then
  tail call void bitcast (void (...)* @g0 to void ()*)() #0
  br label %sw.bb1

sw.bb1:                                           ; preds = %if.then, %sw.bb
  tail call void bitcast (void (...)* @g1 to void ()*)() #0
  br label %sw.bb2

sw.bb2:                                           ; preds = %if.then, %sw.bb1
  tail call void bitcast (void (...)* @g2 to void ()*)() #0
  br label %sw.bb3

sw.bb3:                                           ; preds = %if.then, %sw.bb2
  tail call void bitcast (void (...)* @g3 to void ()*)() #0
  br label %sw.epilog

sw.epilog:                                        ; preds = %sw.bb3, %if.then
  %dummy = tail call i64 @llvm.aarch64.space(i32 32700, i64 %v)
  br label %if.end

if.else:                                          ; preds = %entry
  tail call void bitcast (void (...)* @e to void ()*)() #0
  br label %if.end

if.end:                                           ; preds = %if.else, %sw.epilog
  ret void
}

declare dso_local i32 @test(...) local_unnamed_addr #0

declare dso_local void @g0(...) local_unnamed_addr #0

declare dso_local void @g1(...) local_unnamed_addr #0

declare dso_local void @g2(...) local_unnamed_addr #0

declare dso_local void @g3(...) local_unnamed_addr #0

declare dso_local void @e(...) local_unnamed_addr #0

declare dso_local i64 @llvm.aarch64.space(i32, i64) local_unnamed_addr #0

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" }