blob: 9945da1782b2fd4c924122aeea113d4a7744ac7c [file] [log] [blame]
Krzysztof Parzyszeke720feb2017-03-02 21:49:49 +00001; RUN: llc -march=hexagon -disable-block-placement < %s | FileCheck %s
2
3; Check that the branch to the block b10 is marked as taken (i.e. ":t").
4; CHECK-LABEL: foo
5; CHECK: if ({{.*}}) jump:t .LBB0_[[LAB:[0-9]+]]
6; CHECK: [[LAB]]:
7; CHECK: add({{.*}},#65)
8
9target triple = "hexagon"
10
11define i32 @foo(i32 %a0) local_unnamed_addr #0 {
12b1:
13 %v2 = icmp eq i32 %a0, 0
14 br i1 %v2, label %b3, label %b10, !prof !0
15
16b3: ; preds = %b1
17 br label %b4
18
19b4: ; preds = %b4, %b3
20 %v5 = phi i32 [ %v6, %b4 ], [ 0, %b3 ]
21 %v6 = add nuw nsw i32 %v5, 1
22 %v7 = mul nuw nsw i32 %v5, 67
23 %v8 = tail call i32 @bar(i32 %v7) #0
24 %v9 = icmp eq i32 %v6, 10
25 br i1 %v9, label %b13, label %b4
26
27b10: ; preds = %b1
28 %v11 = add nsw i32 %a0, 65
29 %v12 = tail call i32 @bar(i32 %v11) #0
30 br label %b14
31
32b13: ; preds = %b4
33 br label %b14
34
35b14: ; preds = %b13, %b10
36 %v15 = phi i32 [ %v12, %b10 ], [ 0, %b13 ]
37 ret i32 %v15
38}
39
40declare i32 @bar(i32) local_unnamed_addr #0
41
42attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvx,-hvx-double,-long-calls" }
43
44!0 = !{!"branch_weights", i32 1, i32 2000}