-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[WPD] Remove undef from tests #170179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WPD] Remove undef from tests #170179
Conversation
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.
|
@llvm/pr-subscribers-llvm-transforms Author: Aiden Grossman (boomanaiden154) ChangesAvoid 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. Full diff: https://github.com/llvm/llvm-project/pull/170179.diff 4 Files Affected:
diff --git a/llvm/test/Transforms/WholeProgramDevirt/calls-to-devirt.ll b/llvm/test/Transforms/WholeProgramDevirt/calls-to-devirt.ll
index c6945662690c7..3af72a1efca36 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/calls-to-devirt.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/calls-to-devirt.ll
@@ -41,7 +41,7 @@ define i32 @call1(ptr %obj) #0 {
ret i32 %result
}
-define i1 @call2(ptr %obj) #0 {
+define i1 @call2(ptr %obj, i32 %arg1) #0 {
%vtable = load ptr, ptr %obj
%pair = call {ptr, i1} @llvm.type.checked.load(ptr %vtable, i32 8, metadata !"typeid2")
%fptr = extractvalue {ptr, i1} %pair, 0
@@ -49,7 +49,7 @@ define i1 @call2(ptr %obj) #0 {
br i1 %p, label %cont, label %trap
cont:
- %result = call i1 %fptr(ptr %obj, i32 undef)
+ %result = call i1 %fptr(ptr %obj, i32 %arg1)
ret i1 %result
trap:
diff --git a/llvm/test/Transforms/WholeProgramDevirt/import-indir.ll b/llvm/test/Transforms/WholeProgramDevirt/import-indir.ll
index e4d6f1d52b540..2c33059b6e126 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/import-indir.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/import-indir.ll
@@ -92,7 +92,7 @@ define i1 @f1(ptr %obj) {
}
; CHECK: define i1 @f2
-define i1 @f2(ptr %obj) {
+define i1 @f2(ptr %obj, i32 %arg1) {
%vtable = load ptr, ptr %obj
%pair = call {ptr, i1} @llvm.type.checked.load(ptr %vtable, i32 4, metadata !"typeid1")
%fptr = extractvalue {ptr, i1} %pair, 0
@@ -103,7 +103,7 @@ define i1 @f2(ptr %obj) {
cont:
; CHECK: call i1 %
- %result = call i1 %fptr(ptr %obj, i32 undef)
+ %result = call i1 %fptr(ptr %obj, i32 %arg1)
ret i1 %result
trap:
diff --git a/llvm/test/Transforms/WholeProgramDevirt/import.ll b/llvm/test/Transforms/WholeProgramDevirt/import.ll
index 4e4df5f35a777..812ffbdf7f3fb 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/import.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/import.ll
@@ -40,7 +40,7 @@ define i32 @call1(ptr %obj) #0 {
; constant propagation.
; CHECK: define i1 @call2
-define i1 @call2(ptr %obj) #0 {
+define i1 @call2(ptr %obj, i32 %arg1) #0 {
%vtable = load ptr, ptr %obj
%pair = call {ptr, i1} @llvm.type.checked.load(ptr %vtable, i32 8, metadata !"typeid2")
%fptr = extractvalue {ptr, i1} %pair, 0
@@ -51,8 +51,8 @@ define i1 @call2(ptr %obj) #0 {
cont:
; SINGLE-IMPL: call i1 @singleimpl2
; INDIR: call i1 %
- ; BRANCH-FUNNEL: call i1 @__typeid_typeid2_8_branch_funnel(ptr nest %vtable, ptr %obj, i32 undef)
- %result = call i1 %fptr(ptr %obj, i32 undef)
+ ; BRANCH-FUNNEL: call i1 @__typeid_typeid2_8_branch_funnel(ptr nest %vtable, ptr %obj, i32 %arg1)
+ %result = call i1 %fptr(ptr %obj, i32 %arg1)
ret i1 %result
trap:
diff --git a/llvm/test/Transforms/WholeProgramDevirt/uniform-retval-invoke.ll b/llvm/test/Transforms/WholeProgramDevirt/uniform-retval-invoke.ll
index 88d539294777e..ca42368330fcf 100644
--- a/llvm/test/Transforms/WholeProgramDevirt/uniform-retval-invoke.ll
+++ b/llvm/test/Transforms/WholeProgramDevirt/uniform-retval-invoke.ll
@@ -15,7 +15,7 @@ define i32 @vf2(ptr %this) readnone {
}
; CHECK: define i32 @call
-define i32 @call(ptr %obj) personality ptr undef {
+define i32 @call(ptr %obj) personality ptr @__gxx_personality_v0 {
%vtable = load ptr, ptr %obj
%p = call i1 @llvm.type.test(ptr %vtable, metadata !"typeid")
call void @llvm.assume(i1 %p)
@@ -35,5 +35,6 @@ ret:
declare i1 @llvm.type.test(ptr, metadata)
declare void @llvm.assume(i1)
+declare i32 @__gxx_personality_v0(...)
!0 = !{i32 0, !"typeid"}
|
teresajohnson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
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.