[llvm] aff69e1 - [LazyCallGraph] Convert tests to opaque pointers (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 03:20:16 PST 2022


Author: Nikita Popov
Date: 2022-12-16T12:20:01+01:00
New Revision: aff69e1ec203129e56282afda9b7f2d59621f5d0

URL: https://github.com/llvm/llvm-project/commit/aff69e1ec203129e56282afda9b7f2d59621f5d0
DIFF: https://github.com/llvm/llvm-project/commit/aff69e1ec203129e56282afda9b7f2d59621f5d0.diff

LOG: [LazyCallGraph] Convert tests to opaque pointers (NFC)

Added: 
    

Modified: 
    llvm/test/Analysis/LazyCallGraph/alias.ll
    llvm/test/Analysis/LazyCallGraph/basic.ll
    llvm/test/Analysis/LazyCallGraph/blockaddress.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Analysis/LazyCallGraph/alias.ll b/llvm/test/Analysis/LazyCallGraph/alias.ll
index 054c4d991a2d8..cc1513ff85a94 100644
--- a/llvm/test/Analysis/LazyCallGraph/alias.ll
+++ b/llvm/test/Analysis/LazyCallGraph/alias.ll
@@ -18,21 +18,21 @@ target triple = "x86_64-grtev4-linux-gnu"
 
 ; CHECK-NOT:       baz
 
- at alias1 = weak dso_local alias i8* (i8*), i8* (i8*)* @foo
+ at alias1 = weak dso_local alias ptr (ptr), ptr @foo
 
-define dso_local i8* @foo(i8* %returned) {
-  ret i8* %returned
+define dso_local ptr @foo(ptr %returned) {
+  ret ptr %returned
 }
 
- at alias2 = weak dso_local alias i8* (i8*), i8* (i8*)* @bar
+ at alias2 = weak dso_local alias ptr (ptr), ptr @bar
 
-define internal i8* @bar(i8* %returned) {
-  ret i8* %returned
+define internal ptr @bar(ptr %returned) {
+  ret ptr %returned
 }
 
 ; Internal alias is not reachable.
- at alias3 = internal alias i8* (i8*), i8* (i8*)* @baz
+ at alias3 = internal alias ptr (ptr), ptr @baz
 
-define internal i8* @baz(i8* %returned) {
-  ret i8* %returned
+define internal ptr @baz(ptr %returned) {
+  ret ptr %returned
 }

diff  --git a/llvm/test/Analysis/LazyCallGraph/basic.ll b/llvm/test/Analysis/LazyCallGraph/basic.ll
index eaaecc53801c6..b1a733f4f3212 100644
--- a/llvm/test/Analysis/LazyCallGraph/basic.ll
+++ b/llvm/test/Analysis/LazyCallGraph/basic.ll
@@ -63,7 +63,7 @@ entry:
   ret void
 }
 
-define void ()* @test1(void ()** %x) personality i32 (...)* @__gxx_personality_v0 {
+define ptr @test1(ptr %x) personality ptr @__gxx_personality_v0 {
 ; CHECK-LABEL: Edges in function: test1
 ; CHECK-NEXT: call -> f6
 ; CHECK-NEXT: call -> f10
@@ -86,26 +86,26 @@ dead:
   br label %next
 
 next:
-  phi void ()* [ @f1, %entry ], [ @f2, %dead ]
-  select i1 true, void ()* @f3, void ()* @f4
-  store void ()* @f5, void ()** %x
+  phi ptr [ @f1, %entry ], [ @f2, %dead ]
+  select i1 true, ptr @f3, ptr @f4
+  store ptr @f5, ptr %x
   call void @f6()
-  call void (void ()*, void ()*) bitcast (void ()* @f7 to void (void ()*, void ()*)*)(void ()* @f8, void ()* @f9)
+  call void (ptr, ptr) @f7(ptr @f8, ptr @f9)
   invoke void @f10() to label %exit unwind label %unwind
 
 exit:
-  ret void ()* @f11
+  ret ptr @f11
 
 unwind:
-  %res = landingpad { i8*, i32 }
+  %res = landingpad { ptr, i32 }
           cleanup
-  resume { i8*, i32 } { i8* bitcast (void ()* @f12 to i8*), i32 42 }
+  resume { ptr, i32 } { ptr @f12, i32 42 }
 }
 
- at g = global void ()* @f1
- at g1 = global [4 x void ()*] [void ()* @f2, void ()* @f3, void ()* @f4, void ()* @f5]
- at g2 = global {i8, void ()*, i8} {i8 1, void ()* @f6, i8 2}
- at h = constant void ()* @f7
+ at g = global ptr @f1
+ at g1 = global [4 x ptr] [ptr @f2, ptr @f3, ptr @f4, ptr @f5]
+ at g2 = global {i8, ptr, i8} {i8 1, ptr @f6, i8 2}
+ at h = constant ptr @f7
 
 define void @test2() {
 ; CHECK-LABEL: Edges in function: test2
@@ -118,14 +118,14 @@ define void @test2() {
 ; CHECK-NEXT: ref -> f1
 ; CHECK-NOT: ->
 
-  load i8*, i8** bitcast (void ()** @g to i8**)
-  load i8*, i8** bitcast (void ()** getelementptr ([4 x void ()*], [4 x void ()*]* @g1, i32 0, i32 2) to i8**)
-  load i8*, i8** bitcast (void ()** getelementptr ({i8, void ()*, i8}, {i8, void ()*, i8}* @g2, i32 0, i32 1) to i8**)
-  load i8*, i8** bitcast (void ()** @h to i8**)
+  load ptr, ptr @g
+  load ptr, ptr getelementptr ([4 x ptr], ptr @g1, i32 0, i32 2)
+  load ptr, ptr getelementptr ({i8, ptr, i8}, ptr @g2, i32 0, i32 1)
+  load ptr, ptr @h
   ret void
 }
 
- at test3_ptr = external global void ()*
+ at test3_ptr = external global ptr
 
 define void @test3_aa1() {
 ; CHECK-LABEL: Edges in function: test3_aa1
@@ -135,7 +135,7 @@ define void @test3_aa1() {
 
 entry:
   call void @test3_aa2()
-  store void ()* @test3_ab1, void ()** @test3_ptr
+  store ptr @test3_ab1, ptr @test3_ptr
   ret void
 }
 
@@ -183,7 +183,7 @@ define void @test3_ac1() {
 
 entry:
   call void @test3_ac2()
-  store void ()* @test3_aa2, void ()** @test3_ptr
+  store ptr @test3_aa2, ptr @test3_ptr
   ret void
 }
 
@@ -195,7 +195,7 @@ define void @test3_ac2() {
 
 entry:
   call void @test3_ac1()
-  store void ()* @test3_ba1, void ()** @test3_ptr
+  store ptr @test3_ba1, ptr @test3_ptr
   ret void
 }
 
@@ -207,7 +207,7 @@ define void @test3_ba1() {
 
 entry:
   call void @test3_bb1()
-  store void ()* @test3_ca1, void ()** @test3_ptr
+  store ptr @test3_ca1, ptr @test3_ptr
   ret void
 }
 
@@ -219,7 +219,7 @@ define void @test3_bb1() {
 
 entry:
   call void @test3_ca2()
-  store void ()* @test3_ba1, void ()** @test3_ptr
+  store ptr @test3_ba1, ptr @test3_ptr
   ret void
 }
 

diff  --git a/llvm/test/Analysis/LazyCallGraph/blockaddress.ll b/llvm/test/Analysis/LazyCallGraph/blockaddress.ll
index cf2d00bce6db8..4ce41c500fba8 100644
--- a/llvm/test/Analysis/LazyCallGraph/blockaddress.ll
+++ b/llvm/test/Analysis/LazyCallGraph/blockaddress.ll
@@ -6,8 +6,8 @@ define i32 @baz(i32 %y, i1 %b) {
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br i1 [[B:%.*]], label [[LAB:%.*]], label [[FOR_COND:%.*]]
 ; CHECK:       for.cond:
-; CHECK-NEXT:    [[P_0:%.*]] = phi i8* [ null, [[FOR_COND]] ], [ blockaddress(@baz, [[LAB]]), [[ENTRY:%.*]] ]
-; CHECK-NEXT:    [[INCDEC_PTR:%.*]] = getelementptr inbounds i8, i8* [[P_0]], i64 1
+; CHECK-NEXT:    [[P_0:%.*]] = phi ptr [ null, [[FOR_COND]] ], [ blockaddress(@baz, [[LAB]]), [[ENTRY:%.*]] ]
+; CHECK-NEXT:    [[INCDEC_PTR:%.*]] = getelementptr inbounds i8, ptr [[P_0]], i64 1
 ; CHECK-NEXT:    br label [[FOR_COND]]
 ; CHECK:       lab:
 ; CHECK-NEXT:    ret i32 0
@@ -19,8 +19,8 @@ for.cond.preheader:
   br label %for.cond
 
 for.cond:
-  %p.0 = phi i8* [ null, %for.cond ], [ blockaddress(@baz, %lab), %for.cond.preheader ]
-  %incdec.ptr = getelementptr inbounds i8, i8* %p.0, i64 1
+  %p.0 = phi ptr [ null, %for.cond ], [ blockaddress(@baz, %lab), %for.cond.preheader ]
+  %incdec.ptr = getelementptr inbounds i8, ptr %p.0, i64 1
   br label %for.cond
 
 lab:


        


More information about the llvm-commits mailing list