File: builtin-expect.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (44 lines) | stat: -rw-r--r-- 1,330 bytes parent folder | download | duplicates (6)
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
; RUN: llc -mtriple=hexagon -disable-block-placement < %s | FileCheck %s

; Check that the branch to the block b10 is marked as taken (i.e. ":t").
; CHECK-LABEL: foo
; CHECK: if ({{.*}}) jump:t .LBB0_[[LAB:[0-9]+]]
; CHECK: [[LAB]]:
; CHECK: add({{.*}},#65)

target triple = "hexagon"

define i32 @foo(i32 %a0) local_unnamed_addr #0 {
b1:
  %v2 = icmp eq i32 %a0, 0
  br i1 %v2, label %b3, label %b10, !prof !0

b3:                                               ; preds = %b1
  br label %b4

b4:                                               ; preds = %b4, %b3
  %v5 = phi i32 [ %v6, %b4 ], [ 0, %b3 ]
  %v6 = add nuw nsw i32 %v5, 1
  %v7 = mul nuw nsw i32 %v5, 67
  %v8 = tail call i32 @bar(i32 %v7) #0
  %v9 = icmp eq i32 %v6, 10
  br i1 %v9, label %b13, label %b4

b10:                                              ; preds = %b1
  %v11 = add nsw i32 %a0, 65
  %v12 = tail call i32 @bar(i32 %v11) #0
  br label %b14

b13:                                              ; preds = %b4
  br label %b14

b14:                                              ; preds = %b13, %b10
  %v15 = phi i32 [ %v12, %b10 ], [ 0, %b13 ]
  ret i32 %v15
}

declare i32 @bar(i32) local_unnamed_addr #0

attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvx,+hvx-length64b,-long-calls" }

!0 = !{!"branch_weights", i32 1, i32 2000}