From: Nikita Popov Date: Tue, 13 Dec 2022 15:10:51 +0000 (+0100) Subject: [ThinLTOBitcodeWriter] Convert tests to opaque pointers (NFC) X-Git-Tag: upstream/17.0.6~24018 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9950ea66203849df25352b8db8f4ea108ef47a5a;p=platform%2Fupstream%2Fllvm.git [ThinLTOBitcodeWriter] Convert tests to opaque pointers (NFC) --- diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/associated.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/associated.ll index 600791d..04fbd1c 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/associated.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/associated.ll @@ -11,4 +11,4 @@ @assoc = private constant i8 2, !associated !1 !0 = !{i32 0, !"typeid"} -!1 = !{i8* @g} +!1 = !{ptr @g} diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-debug-info-cloned-type-references-global-value.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-debug-info-cloned-type-references-global-value.ll index 6d77b19..9c4e67d 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-debug-info-cloned-type-references-global-value.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-debug-info-cloned-type-references-global-value.ll @@ -28,7 +28,7 @@ declare !type !17 !type !18 void @_Z1gIM1iKFivEEvT_(i64, i64) !4 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "o", file: !5, line: 22, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !2, templateParams: !6, identifier: "_ZTS1oI1iiXadL_ZNKS0_5m_fn1EvEEE") !5 = !DIFile(filename: "t.ii", directory: "/tmp") !6 = !{!7} -!7 = !DITemplateValueParameter(type: !8, value: i64 ptrtoint (i32* @_ZNK1i5m_fn1Ev to i64)) +!7 = !DITemplateValueParameter(type: !8, value: i64 ptrtoint (ptr @_ZNK1i5m_fn1Ev to i64)) !8 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !9, size: 128, extraData: !13) !9 = !DISubroutineType(types: !10) !10 = !{!11, !12} @@ -37,6 +37,6 @@ declare !type !17 !type !18 void @_Z1gIM1iKFivEEvT_(i64, i64) !13 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "i", file: !5, line: 13, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !2, identifier: "_ZTS1i") !14 = !{i32 2, !"Debug Info Version", i32 3} !15 = !{i32 4, !"CFI Canonical Jump Tables", i32 0} -!16 = !{i64 ptrtoint (i32* @_ZNK1i5m_fn1Ev to i64)} +!16 = !{i64 ptrtoint (ptr @_ZNK1i5m_fn1Ev to i64)} !17 = !{i64 0, !"_ZTSFvM1iKFivEE"} !18 = !{i64 0, !"_ZTSFvM1iKFivEE.generalized"} diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll index ff8fc5b..d8ebae1 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll @@ -6,11 +6,11 @@ target triple = "x86_64-unknown-linux-gnu" ; CHECK: module asm ".lto_set_conditional a,a.[[HASH:[0-9a-f]+]]" define void @b() { - %f = alloca void ()*, align 8 + %f = alloca ptr, align 8 ; CHECK: store{{.*}} @a.[[HASH]],{{.*}} %f - store void ()* @a, void ()** %f, align 8 - ; CHECK: %1 = call void ()* asm sideeffect "leaq a(%rip) - %1 = call void ()* asm sideeffect "leaq a(%rip), $0\0A\09", "=r,~{dirflag},~{fpsr},~{flags}"() + store ptr @a, ptr %f, align 8 + ; CHECK: %1 = call ptr asm sideeffect "leaq a(%rip) + %1 = call ptr asm sideeffect "leaq a(%rip), $0\0A\09", "=r,~{dirflag},~{fpsr},~{flags}"() ret void } diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/circular-reference.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/circular-reference.ll index fb239b0..9e044bb 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/circular-reference.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/circular-reference.ll @@ -4,6 +4,6 @@ ; M0: @g = external constant ; M1: @g = constant -@g = constant i8* bitcast (i8** @g to i8*), !type !0 +@g = constant ptr @g, !type !0 !0 = !{i32 0, !"typeid"} diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll index a43fa1c..f9545e2 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll @@ -23,7 +23,7 @@ $nt = comdat any ; MERGED: @lwt_aliasee = private unnamed_addr global ; MERGED-SAME: comdat(${{"?lwt[^ ]+}}) -@lwt_aliasee = private unnamed_addr global [1 x i8*] [i8* null], comdat($lwt), !type !0 +@lwt_aliasee = private unnamed_addr global [1 x ptr] [ptr null], comdat($lwt), !type !0 ; MERGED: {{@"?lwt_nl[^ ]+}} = hidden unnamed_addr global ; MERGED-SAME: comdat(${{"?lwt[^ ]+}}) @@ -32,7 +32,7 @@ $nt = comdat any ; MERGED: @nlwt_aliasee = private unnamed_addr global ; MERGED-SAME: comdat($nlwt) -@nlwt_aliasee = private unnamed_addr global [1 x i8*] [i8* null], comdat($nlwt), !type !0 +@nlwt_aliasee = private unnamed_addr global [1 x ptr] [ptr null], comdat($nlwt), !type !0 ; MERGED: @nlwt = unnamed_addr global ; MERGED-SAME: comdat @@ -41,7 +41,7 @@ $nt = comdat any ; THIN: @nt = internal ; THIN-SAME: comdat -@nt = internal unnamed_addr global [1 x i8*] [i8* null], comdat +@nt = internal unnamed_addr global [1 x ptr] [ptr null], comdat ; THIN: @nt_nl = internal ; THIN-SAME: comdat($nt) @@ -49,32 +49,32 @@ $nt = comdat any ; MERGED: {{@"?lwt[^ ]+}} = hidden unnamed_addr alias ; THIN: {{@"?lwt[^ ]+}} = external hidden -@lwt = internal unnamed_addr alias [1 x i8*], [1 x i8*]* @lwt_aliasee +@lwt = internal unnamed_addr alias [1 x ptr], ptr @lwt_aliasee ; MERGED: {{@"?nlwt_nl[^ ]+}} = hidden unnamed_addr alias ; THIN: {{@"?nlwt_nl[^ ]+}} = external hidden -@nlwt_nl = internal unnamed_addr alias [1 x i8*], [1 x i8*]* @nlwt_aliasee +@nlwt_nl = internal unnamed_addr alias [1 x ptr], ptr @nlwt_aliasee ; The functions below exist just to make sure the globals are used. -define i8* @lwt_fun() { - %1 = load i32, i32* @lwt_nl - %2 = getelementptr inbounds [1 x i8*], [1 x i8*]* @lwt, i32 0, i32 %1 - %3 = load i8*, i8** %2 - ret i8* %3 +define ptr @lwt_fun() { + %1 = load i32, ptr @lwt_nl + %2 = getelementptr inbounds [1 x ptr], ptr @lwt, i32 0, i32 %1 + %3 = load ptr, ptr %2 + ret ptr %3 } -define i8* @nlwt_fun() { - %1 = load i32, i32* @nlwt - %2 = getelementptr inbounds [1 x i8*], [1 x i8*]* @nlwt_nl, i32 0, i32 %1 - %3 = load i8*, i8** %2 - ret i8* %3 +define ptr @nlwt_fun() { + %1 = load i32, ptr @nlwt + %2 = getelementptr inbounds [1 x ptr], ptr @nlwt_nl, i32 0, i32 %1 + %3 = load ptr, ptr %2 + ret ptr %3 } -define i8* @nt_fun() { - %1 = load i32, i32* @nt_nl - %2 = getelementptr inbounds [1 x i8*], [1 x i8*]* @nt, i32 0, i32 %1 - %3 = load i8*, i8** %2 - ret i8* %3 +define ptr @nt_fun() { + %1 = load i32, ptr @nt_nl + %2 = getelementptr inbounds [1 x ptr], ptr @nt, i32 0, i32 %1 + %3 = load ptr, ptr %2 + ret ptr %3 } !0 = !{i64 8, !"?AVA@@"} diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll index 200d494..dd3e161 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll @@ -2,18 +2,18 @@ ; RUN: llvm-modextract -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=CHECK0 %s ; RUN: llvm-modextract -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=CHECK1 %s ; CHECK0-NOT: @{{.*}}anon{{.*}}= -; CHECK0: @al = external global i8* +; CHECK0: @al = external global ptr ; CHECK0-NOT: @{{.*}}anon{{.*}}= -; CHECK1: @al = unnamed_addr alias i8*, +; CHECK1: @al = unnamed_addr alias ptr, target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-windows-msvc19.0.24215" $al = comdat any -@anon = private unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* null] }, comdat($al), !type !0 +@anon = private unnamed_addr constant { [1 x ptr] } { [1 x ptr] [ptr null] }, comdat($al), !type !0 -@al = external unnamed_addr alias i8*, getelementptr inbounds ({ [1 x i8*] }, { [1 x i8*] }* @anon, i32 0, i32 0, i32 1) +@al = external unnamed_addr alias ptr, getelementptr inbounds ({ [1 x ptr] }, ptr @anon, i32 0, i32 0, i32 1) @foo = global i32 1 diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/function-alias.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/function-alias.ll index a1dbd96..efc04e9 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/function-alias.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/function-alias.ll @@ -12,14 +12,14 @@ define hidden void @Func() !type !0 { ; CHECK1: ![[A1]] = !{!"Alias", !"Func", i8 1, i8 0} ; CHECK1: ![[A2]] = !{!"Hidden_Alias", !"Func", i8 1, i8 0} ; CHECK1: ![[A3]] = !{!"Weak_Alias", !"Func", i8 0, i8 1} -@Alias = hidden alias void (), void ()* @Func -@Hidden_Alias = hidden alias void (), void ()* @Func -@Weak_Alias = weak alias void (), void ()* @Func +@Alias = hidden alias void (), ptr @Func +@Hidden_Alias = hidden alias void (), ptr @Func +@Weak_Alias = weak alias void (), ptr @Func @Variable = global i32 0 ; Only generate summary alias information for aliases to functions ; CHECK1-NOT: Variable_Alias -@Variable_Alias = alias i32, i32* @Variable +@Variable_Alias = alias i32, ptr @Variable !0 = !{i64 0, !"_ZTSFvvE"} diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/pr33536.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/pr33536.ll index 5d688fd..8e78921 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/pr33536.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/pr33536.ll @@ -8,19 +8,19 @@ target triple = "x86_64-unknown-linux-gnu" %struct.hoge = type { %struct.widget } -%struct.widget = type { i32 (...)** } +%struct.widget = type { ptr } ; M0: @global = local_unnamed_addr global ; M1-NOT: @global -@global = local_unnamed_addr global %struct.hoge { %struct.widget { i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @global.1, i32 0, inrange i32 0, i32 2) to i32 (...)**) } }, align 8 +@global = local_unnamed_addr global %struct.hoge { %struct.widget { ptr getelementptr inbounds ({ [3 x ptr] }, ptr @global.1, i32 0, inrange i32 0, i32 2) } }, align 8 ; M0: @global.1 = external unnamed_addr constant ; M1: @global.1 = linkonce_odr unnamed_addr constant -@global.1 = linkonce_odr unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @global.4 to i8*), i8* bitcast (i32 (%struct.widget*)* @quux to i8*)] }, align 8, !type !0 +@global.1 = linkonce_odr unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr @global.4, ptr @quux] }, align 8, !type !0 ; M0: @global.2 = external global ; M1-NOT: @global.2 -@global.2 = external global i8* +@global.2 = external global ptr ; M0: @global.3 = linkonce_odr constant ; M1-NOT: @global.3 @@ -28,10 +28,10 @@ target triple = "x86_64-unknown-linux-gnu" ; M0: @global.4 = linkonce_odr constant ; M1: @global.4 = external constant -@global.4 = linkonce_odr constant { i8*, i8* }{ i8* bitcast (i8** getelementptr inbounds (i8*, i8** @global.2, i64 2) to i8*), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @global.3, i32 0, i32 0) } +@global.4 = linkonce_odr constant { ptr, ptr }{ ptr getelementptr inbounds (ptr, ptr @global.2, i64 2), ptr @global.3 } -@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer +@llvm.global_ctors = appending global [0 x { i32, ptr, ptr }] zeroinitializer -declare i32 @quux(%struct.widget*) unnamed_addr +declare i32 @quux(ptr) unnamed_addr !0 = !{i64 16, !"yyyyyyyyyyyyyyyyyyyyyyyyy"} diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-dsolocal.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-dsolocal.ll index 78dfba4..4664a6f 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-dsolocal.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-dsolocal.ll @@ -10,14 +10,14 @@ ; M1: @default = dso_local constant [1 x i8] c"0", !type !0 ; M1: @hidden = hidden constant [1 x i8] c"0", !type !0 -; M1: @al = dso_local alias [1 x i8], [1 x i8]* @default +; M1: @al = dso_local alias [1 x i8], ptr @default @default = dso_local constant [1 x i8] c"0", !type !0 @hidden = dso_local hidden constant [1 x i8] c"0", !type !0 -@al = dso_local alias [1 x i8], [1 x i8]* @default +@al = dso_local alias [1 x i8], ptr @default -define [1 x i8]* @f_default() { ret [1 x i8]* @default } -define [1 x i8]* @f_hidden() { ret [1 x i8]* @hidden } -define [1 x i8]* @f_al() { ret [1 x i8]* @al } +define ptr @f_default() { ret ptr @default } +define ptr @f_hidden() { ret ptr @hidden } +define ptr @f_al() { ret ptr @al } !0 = !{i32 0, !"typeid"} diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal-typeid.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal-typeid.ll index 4819100..101658c 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal-typeid.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal-typeid.ll @@ -20,14 +20,14 @@ ; M1-NOT: @f() define void @f() { ; M0: llvm.type.test{{.*}}metadata !"1.f50b51a12bb012bebbeff978335e34cf" - %p = call i1 @llvm.type.test(i8* null, metadata !0) + %p = call i1 @llvm.type.test(ptr null, metadata !0) ; M0: llvm.type.checked.load{{.*}}metadata !"2.f50b51a12bb012bebbeff978335e34cf" - %q = call {i8*, i1} @llvm.type.checked.load(i8* null, i32 0, metadata !3) + %q = call {ptr, i1} @llvm.type.checked.load(ptr null, i32 0, metadata !3) ret void } -declare i1 @llvm.type.test(i8*, metadata) -declare {i8*, i1} @llvm.type.checked.load(i8*, i32, metadata) +declare i1 @llvm.type.test(ptr, metadata) +declare {ptr, i1} @llvm.type.checked.load(ptr, i32, metadata) !0 = distinct !{} ; M1: !0 = !{i32 0, !"1.f50b51a12bb012bebbeff978335e34cf"} diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll index 717c10e..b9d85e9 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll @@ -16,11 +16,11 @@ ; M1: @g.581d7631532fa146ba4061179da39272 = hidden global i8 42, !type !0 @g = internal global i8 42, !type !0 -; M0: define i8* @f() +; M0: define ptr @f() ; M1-NOT: @f() -define i8* @f() { - ; M0: ret i8* @g.581d7631532fa146ba4061179da39272 - ret i8* @g +define ptr @f() { + ; M0: ret ptr @g.581d7631532fa146ba4061179da39272 + ret ptr @g } ; M1: !0 = !{i32 0, !"typeid"} diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll index f50fe3f..df571b3 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll @@ -15,9 +15,9 @@ target triple = "x86_64-unknown-linux-gnu" ; BCA0: