Skip to content

Commit d85d49e

Browse files
[WPD] Remove undef from tests
Avoid the use of undef given it should be going away eventually and is not reccomended for new use. To remove it we either use function arguments or pass in a personality function declaration where relevant.
1 parent dec77e4 commit d85d49e

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

llvm/test/Transforms/WholeProgramDevirt/calls-to-devirt.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ define i32 @call1(ptr %obj) #0 {
4141
ret i32 %result
4242
}
4343

44-
define i1 @call2(ptr %obj) #0 {
44+
define i1 @call2(ptr %obj, i32 %arg1) #0 {
4545
%vtable = load ptr, ptr %obj
4646
%pair = call {ptr, i1} @llvm.type.checked.load(ptr %vtable, i32 8, metadata !"typeid2")
4747
%fptr = extractvalue {ptr, i1} %pair, 0
4848
%p = extractvalue {ptr, i1} %pair, 1
4949
br i1 %p, label %cont, label %trap
5050

5151
cont:
52-
%result = call i1 %fptr(ptr %obj, i32 undef)
52+
%result = call i1 %fptr(ptr %obj, i32 %arg1)
5353
ret i1 %result
5454

5555
trap:

llvm/test/Transforms/WholeProgramDevirt/import-indir.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ define i1 @f1(ptr %obj) {
9292
}
9393

9494
; CHECK: define i1 @f2
95-
define i1 @f2(ptr %obj) {
95+
define i1 @f2(ptr %obj, i32 %arg1) {
9696
%vtable = load ptr, ptr %obj
9797
%pair = call {ptr, i1} @llvm.type.checked.load(ptr %vtable, i32 4, metadata !"typeid1")
9898
%fptr = extractvalue {ptr, i1} %pair, 0
@@ -103,7 +103,7 @@ define i1 @f2(ptr %obj) {
103103

104104
cont:
105105
; CHECK: call i1 %
106-
%result = call i1 %fptr(ptr %obj, i32 undef)
106+
%result = call i1 %fptr(ptr %obj, i32 %arg1)
107107
ret i1 %result
108108

109109
trap:

llvm/test/Transforms/WholeProgramDevirt/import.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ define i32 @call1(ptr %obj) #0 {
4040
; constant propagation.
4141

4242
; CHECK: define i1 @call2
43-
define i1 @call2(ptr %obj) #0 {
43+
define i1 @call2(ptr %obj, i32 %arg1) #0 {
4444
%vtable = load ptr, ptr %obj
4545
%pair = call {ptr, i1} @llvm.type.checked.load(ptr %vtable, i32 8, metadata !"typeid2")
4646
%fptr = extractvalue {ptr, i1} %pair, 0
@@ -51,8 +51,8 @@ define i1 @call2(ptr %obj) #0 {
5151
cont:
5252
; SINGLE-IMPL: call i1 @singleimpl2
5353
; INDIR: call i1 %
54-
; BRANCH-FUNNEL: call i1 @__typeid_typeid2_8_branch_funnel(ptr nest %vtable, ptr %obj, i32 undef)
55-
%result = call i1 %fptr(ptr %obj, i32 undef)
54+
; BRANCH-FUNNEL: call i1 @__typeid_typeid2_8_branch_funnel(ptr nest %vtable, ptr %obj, i32 %arg1)
55+
%result = call i1 %fptr(ptr %obj, i32 %arg1)
5656
ret i1 %result
5757

5858
trap:

llvm/test/Transforms/WholeProgramDevirt/uniform-retval-invoke.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ define i32 @vf2(ptr %this) readnone {
1515
}
1616

1717
; CHECK: define i32 @call
18-
define i32 @call(ptr %obj) personality ptr undef {
18+
define i32 @call(ptr %obj) personality ptr @__gxx_personality_v0 {
1919
%vtable = load ptr, ptr %obj
2020
%p = call i1 @llvm.type.test(ptr %vtable, metadata !"typeid")
2121
call void @llvm.assume(i1 %p)
@@ -35,5 +35,6 @@ ret:
3535

3636
declare i1 @llvm.type.test(ptr, metadata)
3737
declare void @llvm.assume(i1)
38+
declare i32 @__gxx_personality_v0(...)
3839

3940
!0 = !{i32 0, !"typeid"}

0 commit comments

Comments
 (0)