annotate test/Transforms/JumpThreading/range-compare.ll @ 146:3fc4d5c3e21e

set tail call flag for code segment in CGCAll
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:23:36 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ;RUN: opt < %s -jump-threading -S | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 declare void @bar(...)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 declare void @baz(...)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 ; Make sure we thread the end of the bar block to the end of the function.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 define void @test1(i32 %x) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 ; CHECK-LABEL: @test1(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 ; CHECK-NEXT: entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X:%.*]], 9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 ; CHECK-NEXT: br i1 [[CMP]], label [[IF_END_THREAD:%.*]], label [[IF_END:%.*]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 ; CHECK: if.end.thread:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 ; CHECK-NEXT: call void (...) @bar()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 ; CHECK-NEXT: br label [[IF_END4:%.*]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 ; CHECK: if.end:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 ; CHECK-NEXT: [[X_OFF:%.*]] = add i32 [[X]], -3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 ; CHECK-NEXT: [[TMP0:%.*]] = icmp ult i32 [[X_OFF]], 5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 ; CHECK-NEXT: br i1 [[TMP0]], label [[IF_THEN3:%.*]], label [[IF_END4]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 ; CHECK: if.then3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 ; CHECK-NEXT: call void (...) @baz()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 ; CHECK-NEXT: br label [[IF_END4]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 ; CHECK: if.end4:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 ; CHECK-NEXT: ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 %cmp = icmp sgt i32 %x, 9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 call void (...) @bar()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 br label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 if.end: ; preds = %if.then, %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 %x.off = add i32 %x, -3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 %0 = icmp ult i32 %x.off, 5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 br i1 %0, label %if.then3, label %if.end4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 if.then3: ; preds = %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 call void (...) @baz()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 br label %if.end4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 if.end4: ; preds = %if.then3, %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 ; Make sure we thread the false side of the first if to the end of the function.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 define void @test2(i32 %x) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 ; CHECK-LABEL: @test2(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 ; CHECK-NEXT: entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 ; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[X:%.*]], 9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 ; CHECK-NEXT: br i1 [[CMP]], label [[IF_END:%.*]], label [[IF_END4:%.*]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 ; CHECK: if.end:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 ; CHECK-NEXT: call void (...) @bar()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 ; CHECK-NEXT: [[X_OFF:%.*]] = add i32 [[X]], -3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 ; CHECK-NEXT: [[TMP0:%.*]] = icmp ult i32 [[X_OFF]], 5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 ; CHECK-NEXT: br i1 [[TMP0]], label [[IF_THEN3:%.*]], label [[IF_END4]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 ; CHECK: if.then3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 ; CHECK-NEXT: call void (...) @baz()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 ; CHECK-NEXT: br label [[IF_END4]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 ; CHECK: if.end4:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 ; CHECK-NEXT: ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 %cmp = icmp slt i32 %x, 9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 call void (...) @bar()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 br label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 if.end: ; preds = %if.then, %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 %x.off = add i32 %x, -3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 %0 = icmp ult i32 %x.off, 5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 br i1 %0, label %if.then3, label %if.end4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 if.then3: ; preds = %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 call void (...) @baz()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 br label %if.end4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 if.end4: ; preds = %if.then3, %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 ; Negative test to make sure we don't thread when the ranges overlap.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 define void @test3(i32 %x) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 ; CHECK-LABEL: @test3(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 ; CHECK-NEXT: entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X:%.*]], 6
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 ; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 ; CHECK: if.then:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93 ; CHECK-NEXT: call void (...) @bar()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94 ; CHECK-NEXT: br label [[IF_END]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95 ; CHECK: if.end:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
96 ; CHECK-NEXT: [[X_OFF:%.*]] = add i32 [[X]], -3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
97 ; CHECK-NEXT: [[TMP0:%.*]] = icmp ult i32 [[X_OFF]], 5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 ; CHECK-NEXT: br i1 [[TMP0]], label [[IF_THEN3:%.*]], label [[IF_END4:%.*]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99 ; CHECK: if.then3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100 ; CHECK-NEXT: call void (...) @baz()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101 ; CHECK-NEXT: br label [[IF_END4]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 ; CHECK: if.end4:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103 ; CHECK-NEXT: ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104 ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105 entry:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
106 %cmp = icmp sgt i32 %x, 6
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
107 br i1 %cmp, label %if.then, label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
108
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
109 if.then: ; preds = %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
110 call void (...) @bar()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
111 br label %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
112
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
113 if.end: ; preds = %if.then, %entry
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
114 %x.off = add i32 %x, -3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
115 %0 = icmp ult i32 %x.off, 5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
116 br i1 %0, label %if.then3, label %if.end4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
117
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
118 if.then3: ; preds = %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
119 call void (...) @baz()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
120 br label %if.end4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
122 if.end4: ; preds = %if.then3, %if.end
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
123 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
124 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
125