Skip to content

Commit ff5e69e

Browse files
author
git apple-llvm automerger
committed
Merge commit '7cf5581712b2' from llvm.org/main into next
2 parents e3fbbda + 7cf5581 commit ff5e69e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1146
-1277
lines changed

llvm/test/Analysis/BranchProbabilityInfo/basic.ll

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
22

3-
define i32 @test1(i32 %i, i32* %a) {
3+
define i32 @test1(i32 %i, ptr %a) {
44
; CHECK: Printing analysis {{.*}} for function 'test1'
55
entry:
66
br label %body
@@ -9,8 +9,8 @@ entry:
99
body:
1010
%iv = phi i32 [ 0, %entry ], [ %next, %body ]
1111
%base = phi i32 [ 0, %entry ], [ %sum, %body ]
12-
%arrayidx = getelementptr inbounds i32, i32* %a, i32 %iv
13-
%0 = load i32, i32* %arrayidx
12+
%arrayidx = getelementptr inbounds i32, ptr %a, i32 %iv
13+
%0 = load i32, ptr %arrayidx
1414
%sum = add nsw i32 %0, %base
1515
%next = add i32 %iv, 1
1616
%exitcond = icmp eq i32 %next, %i
@@ -197,7 +197,7 @@ exit:
197197

198198
!3 = !{!"branch_weights", i32 100, i32 1}
199199

200-
define i32 @test_cold_call_sites(i32* %a) {
200+
define i32 @test_cold_call_sites(ptr %a) {
201201
; Test that edges to blocks post-dominated by cold call sites
202202
; are marked as not expected to be taken.
203203
; TODO(dnovillo) The calls to regular_function should not be merged, but
@@ -209,8 +209,8 @@ define i32 @test_cold_call_sites(i32* %a) {
209209
; CHECK: edge entry -> else probability is 0x78787f1d / 0x80000000 = 94.12% [HOT edge]
210210

211211
entry:
212-
%gep1 = getelementptr i32, i32* %a, i32 1
213-
%val1 = load i32, i32* %gep1
212+
%gep1 = getelementptr i32, ptr %a, i32 1
213+
%val1 = load i32, ptr %gep1
214214
%cond1 = icmp ugt i32 %val1, 1
215215
br i1 %cond1, label %then, label %else
216216

@@ -220,8 +220,8 @@ then:
220220
br label %exit
221221

222222
else:
223-
%gep2 = getelementptr i32, i32* %a, i32 2
224-
%val2 = load i32, i32* %gep2
223+
%gep2 = getelementptr i32, ptr %a, i32 2
224+
%val2 = load i32, ptr %gep2
225225
%val3 = call i32 @regular_function(i32 %val2)
226226
br label %exit
227227

@@ -231,7 +231,7 @@ exit:
231231
}
232232

233233
; CHECK-LABEL: test_invoke_code_callsite1
234-
define i32 @test_invoke_code_callsite1(i1 %c) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
234+
define i32 @test_invoke_code_callsite1(i1 %c) personality ptr @__gxx_personality_v0 {
235235
entry:
236236
br i1 %c, label %if.then, label %if.end
237237
; Edge "entry->if.end" should have higher probability based on the cold call
@@ -251,7 +251,7 @@ invoke.cont:
251251
br label %if.end
252252

253253
lpad:
254-
%ll = landingpad { i8*, i32 }
254+
%ll = landingpad { ptr, i32 }
255255
cleanup
256256
br label %if.end
257257

@@ -260,7 +260,7 @@ if.end:
260260
}
261261

262262
; CHECK-LABEL: test_invoke_code_callsite2
263-
define i32 @test_invoke_code_callsite2(i1 %c) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
263+
define i32 @test_invoke_code_callsite2(i1 %c) personality ptr @__gxx_personality_v0 {
264264
entry:
265265
br i1 %c, label %if.then, label %if.end
266266

@@ -277,7 +277,7 @@ invoke.cont:
277277
br label %if.end
278278

279279
lpad:
280-
%ll = landingpad { i8*, i32 }
280+
%ll = landingpad { ptr, i32 }
281281
cleanup
282282
call void @ColdFunc() #0
283283
br label %if.end
@@ -287,7 +287,7 @@ if.end:
287287
}
288288

289289
; CHECK-LABEL: test_invoke_code_callsite3
290-
define i32 @test_invoke_code_callsite3(i1 %c) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
290+
define i32 @test_invoke_code_callsite3(i1 %c) personality ptr @__gxx_personality_v0 {
291291
entry:
292292
br i1 %c, label %if.then, label %if.end
293293
; CHECK: edge entry -> if.then probability is 0x078780e3 / 0x80000000 = 5.88%
@@ -306,7 +306,7 @@ invoke.cont:
306306
br label %if.end
307307

308308
lpad:
309-
%ll = landingpad { i8*, i32 }
309+
%ll = landingpad { ptr, i32 }
310310
cleanup
311311
call void @ColdFunc() #0
312312
br label %if.end
@@ -316,7 +316,7 @@ if.end:
316316
}
317317

318318
; CHECK-LABEL: test_invoke_code_profiled
319-
define void @test_invoke_code_profiled(i1 %c) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
319+
define void @test_invoke_code_profiled(i1 %c) personality ptr @__gxx_personality_v0 {
320320
entry:
321321
; CHECK: edge entry -> invoke.to0 probability is 0x7ffff800 / 0x80000000 = 100.00% [HOT edge]
322322
; CHECK: edge entry -> lpad probability is 0x00000800 / 0x80000000 = 0.00%
@@ -339,7 +339,7 @@ invoke.to2:
339339
ret void
340340

341341
lpad:
342-
%ll = landingpad { i8*, i32 }
342+
%ll = landingpad { ptr, i32 }
343343
cleanup
344344
ret void
345345
}

llvm/test/Analysis/BranchProbabilityInfo/deopt-invoke.ll

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
22

3-
declare i32* @"personality_function"() #1
3+
declare ptr @"personality_function"() #1
44
declare void @foo(i32)
55
declare void @bar()
66
declare void @llvm.experimental.deoptimize.isVoid(...)
77
declare void @cold() cold
88

99
; Even though the likeliness of 'invoke' to throw an exception is assessed as low
1010
; all other paths are even less likely. Check that hot paths leads to excepion handler.
11-
define void @test1(i32 %0) personality i32* ()* @"personality_function" !prof !1 {
11+
define void @test1(i32 %0) personality ptr @"personality_function" !prof !1 {
1212
;CHECK: edge entry -> unreached probability is 0x00000001 / 0x80000000 = 0.00%
1313
;CHECK: edge entry -> invoke probability is 0x7fffffff / 0x80000000 = 100.00% [HOT edge]
1414
;CHECK: edge invoke -> invoke.cont.unreached probability is 0x00000000 / 0x80000000 = 0.00%
@@ -28,17 +28,17 @@ unreached:
2828
unreachable
2929

3030
land.pad:
31-
%v20 = landingpad { i8*, i32 }
31+
%v20 = landingpad { ptr, i32 }
3232
cleanup
33-
%v21 = load i8 addrspace(1)*, i8 addrspace(1)* addrspace(256)* inttoptr (i64 8 to i8 addrspace(1)* addrspace(256)*), align 8
33+
%v21 = load ptr addrspace(1), ptr addrspace(256) inttoptr (i64 8 to ptr addrspace(256)), align 8
3434
br label %exit
3535

3636
exit:
3737
call void @bar()
3838
ret void
3939
}
4040

41-
define void @test2(i32 %0) personality i32* ()* @"personality_function" {
41+
define void @test2(i32 %0) personality ptr @"personality_function" {
4242
;CHECK: edge entry -> unreached probability is 0x00000000 / 0x80000000 = 0.00%
4343
;CHECK: edge entry -> invoke probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
4444
;CHECK: edge invoke -> invoke.cont.cold probability is 0x7fff8000 / 0x80000000 = 100.00% [HOT edge]
@@ -58,17 +58,17 @@ unreached:
5858
unreachable
5959

6060
land.pad:
61-
%v20 = landingpad { i8*, i32 }
61+
%v20 = landingpad { ptr, i32 }
6262
cleanup
63-
%v21 = load i8 addrspace(1)*, i8 addrspace(1)* addrspace(256)* inttoptr (i64 8 to i8 addrspace(1)* addrspace(256)*), align 8
63+
%v21 = load ptr addrspace(1), ptr addrspace(256) inttoptr (i64 8 to ptr addrspace(256)), align 8
6464
br label %exit
6565

6666
exit:
6767
call void @bar()
6868
ret void
6969
}
7070

71-
define void @test3(i32 %0) personality i32* ()* @"personality_function" {
71+
define void @test3(i32 %0) personality ptr @"personality_function" {
7272
;CHECK: edge entry -> unreached probability is 0x00000000 / 0x80000000 = 0.00%
7373
;CHECK: edge entry -> invoke probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
7474
;CHECK: edge invoke -> invoke.cont.cold probability is 0x7fff8000 / 0x80000000 = 100.00% [HOT edge]
@@ -87,9 +87,9 @@ unreached:
8787
unreachable
8888

8989
land.pad:
90-
%v20 = landingpad { i8*, i32 }
90+
%v20 = landingpad { ptr, i32 }
9191
cleanup
92-
%v21 = load i8 addrspace(1)*, i8 addrspace(1)* addrspace(256)* inttoptr (i64 8 to i8 addrspace(1)* addrspace(256)*), align 8
92+
%v21 = load ptr addrspace(1), ptr addrspace(256) inttoptr (i64 8 to ptr addrspace(256)), align 8
9393
call void @cold()
9494
br label %exit
9595

0 commit comments

Comments
 (0)