Skip to content

Commit 3b175e1

Browse files
committed
[InstCombine] Regenerate test checks (NFC)
And merge two test files.
1 parent 7b03fdb commit 3b175e1

File tree

2 files changed

+63
-33
lines changed

2 files changed

+63
-33
lines changed
Lines changed: 63 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
12
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
23

34
target datalayout = "e-p:32:32"
45
target triple = "i686-pc-linux-gnu"
56

67
define i32 @main() {
7-
; CHECK-LABEL: @main
8-
; CHECK: %[[call:.*]] = call ptr @ctime(ptr null)
9-
; CHECK: %[[cast:.*]] = ptrtoint ptr %[[call]] to i32
10-
; CHECK: ret i32 %[[cast]]
8+
; CHECK-LABEL: define i32 @main() {
9+
; CHECK-NEXT: [[ENTRY:.*:]]
10+
; CHECK-NEXT: [[TMP:%.*]] = call ptr @ctime(ptr null)
11+
; CHECK-NEXT: [[TMP0:%.*]] = ptrtoint ptr [[TMP]] to i32
12+
; CHECK-NEXT: ret i32 [[TMP0]]
13+
;
1114
entry:
1215
%tmp = call i32 @ctime( ptr null ) ; <i32> [#uses=1]
1316
ret i32 %tmp
@@ -16,13 +19,21 @@ entry:
1619
declare ptr @ctime(ptr)
1720

1821
define internal { i8 } @foo(ptr) {
22+
; CHECK-LABEL: define internal { i8 } @foo(
23+
; CHECK-SAME: ptr [[TMP0:%.*]]) {
24+
; CHECK-NEXT: [[ENTRY:.*:]]
25+
; CHECK-NEXT: ret { i8 } zeroinitializer
26+
;
1927
entry:
2028
ret { i8 } { i8 0 }
2129
}
2230

2331
define void @test_struct_ret() {
24-
; CHECK-LABEL: @test_struct_ret
25-
; CHECK-NOT: bitcast
32+
; CHECK-LABEL: define void @test_struct_ret() {
33+
; CHECK-NEXT: [[ENTRY:.*:]]
34+
; CHECK-NEXT: [[TMP0:%.*]] = call { i8 } @foo(ptr null)
35+
; CHECK-NEXT: ret void
36+
;
2637
entry:
2738
%0 = call { i8 } @foo(ptr null)
2839
ret void
@@ -31,10 +42,13 @@ entry:
3142
declare i32 @fn1(i32)
3243

3344
define i32 @test1(ptr %a) {
34-
; CHECK-LABEL: @test1
35-
; CHECK: %[[cast:.*]] = ptrtoint ptr %a to i32
36-
; CHECK-NEXT: %[[call:.*]] = tail call i32 @fn1(i32 %[[cast]])
37-
; CHECK-NEXT: ret i32 %[[call]]
45+
; CHECK-LABEL: define i32 @test1(
46+
; CHECK-SAME: ptr [[A:%.*]]) {
47+
; CHECK-NEXT: [[ENTRY:.*:]]
48+
; CHECK-NEXT: [[TMP0:%.*]] = ptrtoint ptr [[A]] to i32
49+
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @fn1(i32 [[TMP0]])
50+
; CHECK-NEXT: ret i32 [[CALL]]
51+
;
3852
entry:
3953
%call = tail call i32 @fn1(ptr %a)
4054
ret i32 %call
@@ -43,9 +57,12 @@ entry:
4357
declare i32 @fn2(i16)
4458

4559
define i32 @test2(ptr %a) {
46-
; CHECK-LABEL: @test2
47-
; CHECK: %[[call:.*]] = tail call i32 @fn2(ptr %a)
48-
; CHECK-NEXT: ret i32 %[[call]]
60+
; CHECK-LABEL: define i32 @test2(
61+
; CHECK-SAME: ptr [[A:%.*]]) {
62+
; CHECK-NEXT: [[ENTRY:.*:]]
63+
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @fn2(ptr [[A]])
64+
; CHECK-NEXT: ret i32 [[CALL]]
65+
;
4966
entry:
5067
%call = tail call i32 @fn2(ptr %a)
5168
ret i32 %call
@@ -54,9 +71,12 @@ entry:
5471
declare i32 @fn3(i64)
5572

5673
define i32 @test3(ptr %a) {
57-
; CHECK-LABEL: @test3
58-
; CHECK: %[[call:.*]] = tail call i32 @fn3(ptr %a)
59-
; CHECK-NEXT: ret i32 %[[call]]
74+
; CHECK-LABEL: define i32 @test3(
75+
; CHECK-SAME: ptr [[A:%.*]]) {
76+
; CHECK-NEXT: [[ENTRY:.*:]]
77+
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @fn3(ptr [[A]])
78+
; CHECK-NEXT: ret i32 [[CALL]]
79+
;
6080
entry:
6181
%call = tail call i32 @fn3(ptr %a)
6282
ret i32 %call
@@ -65,9 +85,12 @@ entry:
6585
declare i32 @fn4(i32) "thunk"
6686

6787
define i32 @test4(ptr %a) {
68-
; CHECK-LABEL: @test4
69-
; CHECK: %[[call:.*]] = tail call i32 @fn4(ptr %a)
70-
; CHECK-NEXT: ret i32 %[[call]]
88+
; CHECK-LABEL: define i32 @test4(
89+
; CHECK-SAME: ptr [[A:%.*]]) {
90+
; CHECK-NEXT: [[ENTRY:.*:]]
91+
; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @fn4(ptr [[A]])
92+
; CHECK-NEXT: ret i32 [[CALL]]
93+
;
7194
entry:
7295
%call = tail call i32 @fn4(ptr %a)
7396
ret i32 %call
@@ -76,9 +99,14 @@ entry:
7699
declare i1 @fn5(ptr byval({ i32, i32 }) align 4 %r)
77100

78101
define i1 @test5() {
79-
; CHECK-LABEL: @test5
80-
; CHECK: %[[call:.*]] = call i1 @fn5(i32 {{.*}}, i32 {{.*}})
81-
; CHECK-NEXT: ret i1 %[[call]]
102+
; CHECK-LABEL: define i1 @test5() {
103+
; CHECK-NEXT: [[TMP1:%.*]] = alloca { i32, i32 }, align 4
104+
; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
105+
; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, ptr [[TMP1]], i32 4
106+
; CHECK-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
107+
; CHECK-NEXT: [[TMP5:%.*]] = call i1 @fn5(i32 [[TMP2]], i32 [[TMP4]])
108+
; CHECK-NEXT: ret i1 [[TMP5]]
109+
;
82110
%1 = alloca { i32, i32 }, align 4
83111
%2 = getelementptr inbounds { i32, i32 }, ptr %1, i32 0, i32 0
84112
%3 = load i32, ptr %2, align 4
@@ -87,3 +115,16 @@ define i1 @test5() {
87115
%6 = call i1 @fn5(i32 %3, i32 %5)
88116
ret i1 %6
89117
}
118+
119+
declare void @bundles_callee(i32)
120+
121+
define void @bundles() {
122+
; CHECK-LABEL: define void @bundles() {
123+
; CHECK-NEXT: [[ENTRY:.*:]]
124+
; CHECK-NEXT: call void @bundles_callee(i32 0) [ "deopt"() ]
125+
; CHECK-NEXT: ret void
126+
;
127+
entry:
128+
call void @bundles_callee() [ "deopt"() ]
129+
ret void
130+
}

llvm/test/Transforms/InstCombine/cast-callee-deopt-bundles.ll

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)