[llvm] 3713bc8 - [FunctionImport] Convert tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 13 07:15:47 PST 2022
Author: Nikita Popov
Date: 2022-12-13T16:14:34+01:00
New Revision: 3713bc8a0b38c0c77238e3010e7dd53d50f3c523
URL: https://github.com/llvm/llvm-project/commit/3713bc8a0b38c0c77238e3010e7dd53d50f3c523
DIFF: https://github.com/llvm/llvm-project/commit/3713bc8a0b38c0c77238e3010e7dd53d50f3c523.diff
LOG: [FunctionImport] Convert tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/Transforms/FunctionImport/Inputs/cg_profile.ll
llvm/test/Transforms/FunctionImport/Inputs/comdat.ll
llvm/test/Transforms/FunctionImport/Inputs/funcimport_var2.ll
llvm/test/Transforms/FunctionImport/Inputs/import_stats.ll
llvm/test/Transforms/FunctionImport/Inputs/inlineasm.ll
llvm/test/Transforms/FunctionImport/Inputs/noinline.ll
llvm/test/Transforms/FunctionImport/cg_profile.ll
llvm/test/Transforms/FunctionImport/comdat.ll
llvm/test/Transforms/FunctionImport/funcimport_var.ll
llvm/test/Transforms/FunctionImport/inlineasm.ll
llvm/test/Transforms/FunctionImport/noinline.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/FunctionImport/Inputs/cg_profile.ll b/llvm/test/Transforms/FunctionImport/Inputs/cg_profile.ll
index 5143575e1712b..b04295e930ef6 100644
--- a/llvm/test/Transforms/FunctionImport/Inputs/cg_profile.ll
+++ b/llvm/test/Transforms/FunctionImport/Inputs/cg_profile.ll
@@ -3,7 +3,7 @@ target triple = "x86_64-unknown-linux-gnu"
%class.A = type { [16 x i8] }
-define void @bar(%class.A*) {
+define void @bar(ptr) {
ret void
}
diff --git a/llvm/test/Transforms/FunctionImport/Inputs/comdat.ll b/llvm/test/Transforms/FunctionImport/Inputs/comdat.ll
index 3eac3e31908a3..e986465bb7737 100644
--- a/llvm/test/Transforms/FunctionImport/Inputs/comdat.ll
+++ b/llvm/test/Transforms/FunctionImport/Inputs/comdat.ll
@@ -3,8 +3,8 @@ target triple = "x86_64-pc-windows-msvc19.0.24215"
define void @main() {
entry:
- call i8* @lwt_fun()
+ call ptr @lwt_fun()
ret void
}
-declare i8* @lwt_fun()
+declare ptr @lwt_fun()
diff --git a/llvm/test/Transforms/FunctionImport/Inputs/funcimport_var2.ll b/llvm/test/Transforms/FunctionImport/Inputs/funcimport_var2.ll
index 5a6240aa444de..3ee4b9204b424 100644
--- a/llvm/test/Transforms/FunctionImport/Inputs/funcimport_var2.ll
+++ b/llvm/test/Transforms/FunctionImport/Inputs/funcimport_var2.ll
@@ -4,7 +4,7 @@ target triple = "x86_64-unknown-linux-gnu"
@link = internal global i32 0, align 4
; Function Attrs: norecurse nounwind readnone uwtable
-define nonnull i32* @get_link() local_unnamed_addr {
- ret i32* @link
+define nonnull ptr @get_link() local_unnamed_addr {
+ ret ptr @link
}
diff --git a/llvm/test/Transforms/FunctionImport/Inputs/import_stats.ll b/llvm/test/Transforms/FunctionImport/Inputs/import_stats.ll
index 413f6cea5178b..87d1a959c7eb8 100644
--- a/llvm/test/Transforms/FunctionImport/Inputs/import_stats.ll
+++ b/llvm/test/Transforms/FunctionImport/Inputs/import_stats.ll
@@ -5,7 +5,7 @@ target triple = "x86_64-unknown-linux-gnu"
@globalvar = global i32 1, align 4
define void @hot() {
- store i32 0, i32* @globalvar, align 4
+ store i32 0, ptr @globalvar, align 4
ret void
}
define void @critical() {
diff --git a/llvm/test/Transforms/FunctionImport/Inputs/inlineasm.ll b/llvm/test/Transforms/FunctionImport/Inputs/inlineasm.ll
index aa9029fd12038..061a0a1794c5d 100644
--- a/llvm/test/Transforms/FunctionImport/Inputs/inlineasm.ll
+++ b/llvm/test/Transforms/FunctionImport/Inputs/inlineasm.ll
@@ -1,11 +1,11 @@
@myvar = internal constant i8 1, align 1
- at llvm.used = appending global [1 x i8*] [i8* @myvar], section "llvm.metadata"
+ at llvm.used = appending global [1 x ptr] [ptr @myvar], section "llvm.metadata"
-define void @foo(i64* %v) #0 {
+define void @foo(ptr %v) #0 {
entry:
- %v.addr = alloca i64*, align 8
- store i64* %v, i64** %v.addr, align 8
- %0 = load i64*, i64** %v.addr, align 8
- call void asm sideeffect "movzbl myvar(%rip), %eax\0A\09movq %rax, $0\0A\09", "=*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0) #1
+ %v.addr = alloca ptr, align 8
+ store ptr %v, ptr %v.addr, align 8
+ %0 = load ptr, ptr %v.addr, align 8
+ call void asm sideeffect "movzbl myvar(%rip), %eax\0A\09movq %rax, $0\0A\09", "=*m,~{eax},~{dirflag},~{fpsr},~{flags}"(ptr elementtype(i64) %0) #1
ret void
}
diff --git a/llvm/test/Transforms/FunctionImport/Inputs/noinline.ll b/llvm/test/Transforms/FunctionImport/Inputs/noinline.ll
index 719d7644fbc51..0858d9c91b902 100644
--- a/llvm/test/Transforms/FunctionImport/Inputs/noinline.ll
+++ b/llvm/test/Transforms/FunctionImport/Inputs/noinline.ll
@@ -1,7 +1,7 @@
-define void @foo(i64* %v) #0 {
+define void @foo(ptr %v) #0 {
entry:
- %v.addr = alloca i64*, align 8
- store i64* %v, i64** %v.addr, align 8
+ %v.addr = alloca ptr, align 8
+ store ptr %v, ptr %v.addr, align 8
ret void
}
diff --git a/llvm/test/Transforms/FunctionImport/cg_profile.ll b/llvm/test/Transforms/FunctionImport/cg_profile.ll
index 8c71fe67d3a83..f84b4ea9482af 100644
--- a/llvm/test/Transforms/FunctionImport/cg_profile.ll
+++ b/llvm/test/Transforms/FunctionImport/cg_profile.ll
@@ -10,7 +10,7 @@
; CHECK: !0 = !{i32 1, !"EnableSplitLTOUnit", i32 0}
; CHECK-NEXT: !1 = !{i32 5, !"CG Profile", !2}
; CHECK-NEXT: !2 = distinct !{!3}
-; CHECK-NEXT: !3 = !{void ()* @foo, void (%class.A*)* bitcast (void (%class.A.0*)* @bar to void (%class.A*)*), i64 2753}
+; CHECK-NEXT: !3 = !{ptr @foo, ptr @bar, i64 2753}
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@@ -20,11 +20,11 @@ target triple = "x86_64-unknown-linux-gnu"
%class.A = type { i8 }
define void @foo() !prof !2 {
- call void @bar(%class.A* null)
+ call void @bar(ptr null)
ret void
}
-declare void @bar(%class.A*)
+declare void @bar(ptr)
!llvm.module.flags = !{!1}
diff --git a/llvm/test/Transforms/FunctionImport/comdat.ll b/llvm/test/Transforms/FunctionImport/comdat.ll
index 5e6643f642ef6..5a75abc74fa93 100644
--- a/llvm/test/Transforms/FunctionImport/comdat.ll
+++ b/llvm/test/Transforms/FunctionImport/comdat.ll
@@ -18,15 +18,14 @@ target triple = "x86_64-pc-windows-msvc19.0.24215"
$lwt = comdat any
; CHECK: @lwt_aliasee = private unnamed_addr global {{.*}}, comdat($lwt.llvm.[[HASH]])
- at lwt_aliasee = private unnamed_addr global [1 x i8*] [i8* null], comdat($lwt)
+ at lwt_aliasee = private unnamed_addr global [1 x ptr] [ptr null], comdat($lwt)
; CHECK: @lwt.llvm.[[HASH]] = hidden unnamed_addr alias
- at lwt = internal unnamed_addr alias [1 x i8*], [1 x i8*]* @lwt_aliasee
+ at lwt = internal unnamed_addr alias [1 x ptr], ptr @lwt_aliasee
; Below function should get imported into other module, resulting in @lwt being
; promoted and renamed.
-define i8* @lwt_fun() {
- %1 = getelementptr inbounds [1 x i8*], [1 x i8*]* @lwt, i32 0, i32 0
- %2 = load i8*, i8** %1
- ret i8* %2
+define ptr @lwt_fun() {
+ %1 = load ptr, ptr @lwt
+ ret ptr %1
}
diff --git a/llvm/test/Transforms/FunctionImport/funcimport_var.ll b/llvm/test/Transforms/FunctionImport/funcimport_var.ll
index 0ed6442424fd5..e0a0da58dd939 100644
--- a/llvm/test/Transforms/FunctionImport/funcimport_var.ll
+++ b/llvm/test/Transforms/FunctionImport/funcimport_var.ll
@@ -18,10 +18,10 @@
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define i32 @_Z4LinkPKcS0_(i8*, i8*) local_unnamed_addr {
- %3 = tail call i32 @link(i8* %0, i8* %1) #2
+define i32 @_Z4LinkPKcS0_(ptr, ptr) local_unnamed_addr {
+ %3 = tail call i32 @link(ptr %0, ptr %1) #2
ret i32 %3
}
; Function Attrs: nounwind
-declare i32 @link(i8*, i8*) local_unnamed_addr
+declare i32 @link(ptr, ptr) local_unnamed_addr
diff --git a/llvm/test/Transforms/FunctionImport/inlineasm.ll b/llvm/test/Transforms/FunctionImport/inlineasm.ll
index f9850607255ee..39c384d122969 100644
--- a/llvm/test/Transforms/FunctionImport/inlineasm.ll
+++ b/llvm/test/Transforms/FunctionImport/inlineasm.ll
@@ -11,9 +11,9 @@
define i32 @main() #0 {
entry:
%f = alloca i64, align 8
- call void @foo(i64* %f)
+ call void @foo(ptr %f)
ret i32 0
}
-; CHECK: declare void @foo(i64*)
-declare void @foo(i64*) #1
+; CHECK: declare void @foo(ptr)
+declare void @foo(ptr) #1
diff --git a/llvm/test/Transforms/FunctionImport/noinline.ll b/llvm/test/Transforms/FunctionImport/noinline.ll
index 58a8de51b1c2a..8687f1b3b5f7c 100644
--- a/llvm/test/Transforms/FunctionImport/noinline.ll
+++ b/llvm/test/Transforms/FunctionImport/noinline.ll
@@ -14,10 +14,10 @@
define i32 @main() #0 {
entry:
%f = alloca i64, align 8
- call void @foo(i64* %f)
+ call void @foo(ptr %f)
ret i32 0
}
-; NOIMPORT: declare void @foo(i64*)
+; NOIMPORT: declare void @foo(ptr)
; IMPORT: define available_externally void @foo
-declare void @foo(i64*) #1
+declare void @foo(ptr) #1
More information about the llvm-commits
mailing list