[llvm] 4e4c89a - LTO: Convert tests to opaque pointers

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 19:51:50 PST 2022


Author: Fangrui Song
Date: 2022-11-27T19:51:46-08:00
New Revision: 4e4c89a16e5696f03bd39160a099462d9c847cd5

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

LOG: LTO: Convert tests to opaque pointers

Added: 
    

Modified: 
    llvm/test/LTO/X86/Inputs/codemodel-3.ll
    llvm/test/LTO/X86/Inputs/remangle_intrinsics.ll
    llvm/test/LTO/X86/Inputs/type-mapping-bug3.ll
    llvm/test/LTO/X86/Inputs/type-mapping-src.ll
    llvm/test/LTO/X86/cfi_endproc.ll
    llvm/test/LTO/X86/cfi_jt_aliases.ll
    llvm/test/LTO/X86/codemodel-1.ll
    llvm/test/LTO/X86/codemodel-2.ll
    llvm/test/LTO/X86/codemodel-3.ll
    llvm/test/LTO/X86/diagnostic-handler-remarks.ll
    llvm/test/LTO/X86/inline-asm-lto-discard.ll
    llvm/test/LTO/X86/keep-used-puts-during-instcombine.ll
    llvm/test/LTO/X86/libcall-overridden-via-alias.ll
    llvm/test/LTO/X86/linkonce_odr_func.ll
    llvm/test/LTO/X86/no-undefined-puts-when-implemented.ll
    llvm/test/LTO/X86/objc-detection-i386.ll
    llvm/test/LTO/X86/objc-detection.ll
    llvm/test/LTO/X86/pr38046.ll
    llvm/test/LTO/X86/remangle_intrinsics.ll
    llvm/test/LTO/X86/set-merged.ll
    llvm/test/LTO/X86/stdcall.ll
    llvm/test/LTO/X86/symver-asm.ll
    llvm/test/LTO/X86/tli-nobuiltin.ll
    llvm/test/LTO/X86/triple-init2.ll
    llvm/test/LTO/X86/type-mapping-bug.ll
    llvm/test/LTO/X86/type-mapping-bug2.ll
    llvm/test/LTO/X86/type-mapping-bug3.ll
    llvm/test/LTO/X86/unnamed.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/LTO/X86/Inputs/codemodel-3.ll b/llvm/test/LTO/X86/Inputs/codemodel-3.ll
index a5ec572809272..e81b3d8f63c1a 100644
--- a/llvm/test/LTO/X86/Inputs/codemodel-3.ll
+++ b/llvm/test/LTO/X86/Inputs/codemodel-3.ll
@@ -8,9 +8,9 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 
 %struct.rtx_def = type { i16, i16 }
 
-define void @bar(%struct.rtx_def* %a, i8 %b, i32 %c) {
-  call void  @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def* align 4 %a, i8 %b, i32 %c, i1 true)
+define void @bar(ptr %a, i8 %b, i32 %c) {
+  call void  @llvm.memset.p0.rtx_def.i32(ptr align 4 %a, i8 %b, i32 %c, i1 true)
   ret void
 }
 
-declare void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def*, i8, i32, i1)
+declare void @llvm.memset.p0.rtx_def.i32(ptr, i8, i32, i1)

diff  --git a/llvm/test/LTO/X86/Inputs/remangle_intrinsics.ll b/llvm/test/LTO/X86/Inputs/remangle_intrinsics.ll
index e23973dc3172a..e69bff8f7bd42 100644
--- a/llvm/test/LTO/X86/Inputs/remangle_intrinsics.ll
+++ b/llvm/test/LTO/X86/Inputs/remangle_intrinsics.ll
@@ -2,9 +2,9 @@ target triple = "x86_64-unknown-linux-gnu"
 
 %struct.rtx_def = type { i16, i16 }
 
-define void @bar(%struct.rtx_def* %a, i8 %b, i32 %c) {
-  call void  @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def* align 4 %a, i8 %b, i32 %c, i1 true)
+define void @bar(ptr %a, i8 %b, i32 %c) {
+  call void  @llvm.memset.p0.rtx_def.i32(ptr align 4 %a, i8 %b, i32 %c, i1 true)
   ret void
 }
 
-declare void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def*, i8, i32, i1)
+declare void @llvm.memset.p0.rtx_def.i32(ptr, i8, i32, i1)

diff  --git a/llvm/test/LTO/X86/Inputs/type-mapping-bug3.ll b/llvm/test/LTO/X86/Inputs/type-mapping-bug3.ll
index d6fe8e83a78ae..6b965ef28803a 100644
--- a/llvm/test/LTO/X86/Inputs/type-mapping-bug3.ll
+++ b/llvm/test/LTO/X86/Inputs/type-mapping-bug3.ll
@@ -3,7 +3,7 @@ target triple = "x86_64-unknown-linux-gnu"
 
 ; T2 is the non-opaque struct required to trigger the uniqued T2.0 and T3.0 to
 ; respectively T2 and T3 in the destination module.
-%"T2" = type { %"T3"* }
+%"T2" = type { ptr }
 %"T3" = type opaque
 
 ; Use/refer to T2 so it gets added as an IdentifiedStructType.  The debug

diff  --git a/llvm/test/LTO/X86/Inputs/type-mapping-src.ll b/llvm/test/LTO/X86/Inputs/type-mapping-src.ll
index 94f108d6bb846..ab862308b1cbe 100644
--- a/llvm/test/LTO/X86/Inputs/type-mapping-src.ll
+++ b/llvm/test/LTO/X86/Inputs/type-mapping-src.ll
@@ -5,7 +5,7 @@ target triple = "x86_64-pc-windows-msvc18.0.0"
 %CommonStruct = type opaque
 
 @x = external global %SrcType
- at bar = internal global %CommonStruct* null, !dbg !0
+ at bar = internal global ptr null, !dbg !0
 
 !llvm.dbg.cu = !{!2}
 !llvm.module.flags = !{!8}

diff  --git a/llvm/test/LTO/X86/cfi_endproc.ll b/llvm/test/LTO/X86/cfi_endproc.ll
index 7a9ab2b23b504..1251c0ade80a5 100644
--- a/llvm/test/LTO/X86/cfi_endproc.ll
+++ b/llvm/test/LTO/X86/cfi_endproc.ll
@@ -18,7 +18,7 @@ declare void @PR14512()
 
 ; Without -exported-symbol, main should be eliminated by LTO.
 ; With -exported-symbol=main, main should be preserved by LTO.
-define i32 @main(i32 %argc, i8** %argv) {
+define i32 @main(i32 %argc, ptr %argv) {
 ; NOEXPORT-NOT: main
 ; EXPORT: main
   call void @PR14512()
@@ -29,14 +29,14 @@ define i32 @main(i32 %argc, i8** %argv) {
 ; RUN: llvm-nm %t | FileCheck %s -check-prefix=ZED1_AND_ZED2
 ; ZED1_AND_ZED2: V zed1
 @zed1 = linkonce_odr global i32 42
-define i32* @get_zed1() {
-  ret i32* @zed1
+define ptr @get_zed1() {
+  ret ptr @zed1
 }
 
 ; ZED1_AND_ZED2: r zed2
 @zed2 = linkonce_odr unnamed_addr constant i32 42
 
 define i32 @useZed2() {
-  %x = load i32, i32* @zed2
+  %x = load i32, ptr @zed2
   ret i32 %x
 }

diff  --git a/llvm/test/LTO/X86/cfi_jt_aliases.ll b/llvm/test/LTO/X86/cfi_jt_aliases.ll
index 06737f628a417..9d114f4b78614 100644
--- a/llvm/test/LTO/X86/cfi_jt_aliases.ll
+++ b/llvm/test/LTO/X86/cfi_jt_aliases.ll
@@ -51,7 +51,7 @@
 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"
 
- at f = internal global [4 x void ()*] [void ()* @a, void ()* @b, void ()* @c, void ()* null], align 16
+ at f = internal global [4 x ptr] [ptr @a, ptr @b, ptr @c, ptr null], align 16
 
 define dso_local void @a() !type !5 !type !6 { ret void }
 define dso_local void @b() !type !5 !type !6 { ret void }
@@ -60,25 +60,24 @@ define dso_local void @c() !type !5 !type !6 { ret void }
 define dso_local void @d() !type !5 !type !6 {
 entry:
   %i = alloca i32, align 4
-  store i32 0, i32* %i, align 4
+  store i32 0, ptr %i, align 4
   br label %for.cond
 
 for.cond:                                         ; preds = %for.inc, %entry
-  %0 = load i32, i32* %i, align 4
+  %0 = load i32, ptr %i, align 4
   %idxprom = sext i32 %0 to i64
-  %arrayidx = getelementptr inbounds [4 x void ()*], [4 x void ()*]* @f, i64 0, i64 %idxprom
-  %1 = load void ()*, void ()** %arrayidx, align 8
-  %tobool = icmp ne void ()* %1, null
+  %arrayidx = getelementptr inbounds [4 x ptr], ptr @f, i64 0, i64 %idxprom
+  %1 = load ptr, ptr %arrayidx, align 8
+  %tobool = icmp ne ptr %1, null
   br i1 %tobool, label %for.body, label %for.end
 
 for.body:                                         ; preds = %for.cond
-  %2 = load i32, i32* %i, align 4
+  %2 = load i32, ptr %i, align 4
   %idxprom1 = sext i32 %2 to i64
-  %arrayidx2 = getelementptr inbounds [4 x void ()*], [4 x void ()*]* @f, i64 0, i64 %idxprom1
-  %3 = load void ()*, void ()** %arrayidx2, align 8
-  %4 = bitcast void ()* %3 to i8*, !nosanitize !7
-  %5 = call i1 @llvm.type.test(i8* %4, metadata !"_ZTSFvvE"), !nosanitize !7
-  br i1 %5, label %cont, label %trap, !nosanitize !7
+  %arrayidx2 = getelementptr inbounds [4 x ptr], ptr @f, i64 0, i64 %idxprom1
+  %3 = load ptr, ptr %arrayidx2, align 8
+  %4 = call i1 @llvm.type.test(ptr %3, metadata !"_ZTSFvvE"), !nosanitize !7
+  br i1 %4, label %cont, label %trap, !nosanitize !7
 
 trap:                                             ; preds = %for.body
   call void @llvm.ubsantrap(i8 2), !nosanitize !7
@@ -89,16 +88,16 @@ cont:                                             ; preds = %for.body
   br label %for.inc
 
 for.inc:                                          ; preds = %cont
-  %6 = load i32, i32* %i, align 4
-  %inc = add nsw i32 %6, 1
-  store i32 %inc, i32* %i, align 4
+  %5 = load i32, ptr %i, align 4
+  %inc = add nsw i32 %5, 1
+  store i32 %inc, ptr %i, align 4
   br label %for.cond
 
 for.end:                                          ; preds = %for.cond
   ret void
 }
 
-declare i1 @llvm.type.test(i8*, metadata)
+declare i1 @llvm.type.test(ptr, metadata)
 declare void @llvm.ubsantrap(i8 immarg)
 
 !llvm.module.flags = !{!0, !1, !2, !3}

diff  --git a/llvm/test/LTO/X86/codemodel-1.ll b/llvm/test/LTO/X86/codemodel-1.ll
index 814981dc8b25c..43f51ff5ec7a5 100644
--- a/llvm/test/LTO/X86/codemodel-1.ll
+++ b/llvm/test/LTO/X86/codemodel-1.ll
@@ -12,9 +12,9 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 
 @data = internal constant [0 x i32] []
 
-define i32* @_start() nounwind readonly {
+define ptr @_start() nounwind readonly {
 entry:
 ; CHECK-SMALL-LABEL:  <_start>:
 ; CHECK-SMALL: leaq    (%rip), %rax
-    ret i32* getelementptr ([0 x i32], [0 x i32]* @data, i64 0, i64 0)
+    ret ptr @data
 }

diff  --git a/llvm/test/LTO/X86/codemodel-2.ll b/llvm/test/LTO/X86/codemodel-2.ll
index 003bfaf72eccd..5cd9731606f2b 100644
--- a/llvm/test/LTO/X86/codemodel-2.ll
+++ b/llvm/test/LTO/X86/codemodel-2.ll
@@ -12,9 +12,9 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 
 @data = internal constant [0 x i32] []
 
-define i32* @_start() nounwind readonly {
+define ptr @_start() nounwind readonly {
 entry:
 ; CHECK-LARGE-LABEL: <_start>:
 ; CHECK-LARGE: movabsq $0, %rax
-    ret i32* getelementptr ([0 x i32], [0 x i32]* @data, i64 0, i64 0)
+    ret ptr @data
 }

diff  --git a/llvm/test/LTO/X86/codemodel-3.ll b/llvm/test/LTO/X86/codemodel-3.ll
index 9e03f84b6a0f7..947221e9f36dc 100644
--- a/llvm/test/LTO/X86/codemodel-3.ll
+++ b/llvm/test/LTO/X86/codemodel-3.ll
@@ -12,9 +12,9 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 
 @data = internal constant [0 x i32] []
 
-define i32* @_start() nounwind readonly {
+define ptr @_start() nounwind readonly {
 entry:
-    ret i32* getelementptr ([0 x i32], [0 x i32]* @data, i64 0, i64 0)
+    ret ptr @data
 }
 
 ; CHECK: 'Code Model': IDs have conflicting values

diff  --git a/llvm/test/LTO/X86/diagnostic-handler-remarks.ll b/llvm/test/LTO/X86/diagnostic-handler-remarks.ll
index 6ff6268334e83..af3fb0ed18d02 100644
--- a/llvm/test/LTO/X86/diagnostic-handler-remarks.ll
+++ b/llvm/test/LTO/X86/diagnostic-handler-remarks.ll
@@ -93,39 +93,39 @@ define i32 @main() {
   ret i32 %i
 }
 
-define i32 @func2(i32* %out, i32* %out2, i32* %A, i32* %B, i32* %C, i32* %D, i32* %E, i32* %F) {
+define i32 @func2(ptr %out, ptr %out2, ptr %A, ptr %B, ptr %C, ptr %D, ptr %E, ptr %F) {
 entry:
   br label %for.body
 
 for.body:                                         ; preds = %for.body, %entry
   %i.037 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
-  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %i.037
-  %0 = load i32, i32* %arrayidx, align 4
-  %arrayidx1 = getelementptr inbounds i32, i32* %B, i64 %i.037
-  %1 = load i32, i32* %arrayidx1, align 4
+  %arrayidx = getelementptr inbounds i32, ptr %A, i64 %i.037
+  %0 = load i32, ptr %arrayidx, align 4
+  %arrayidx1 = getelementptr inbounds i32, ptr %B, i64 %i.037
+  %1 = load i32, ptr %arrayidx1, align 4
   %add = add nsw i32 %1, %0
-  %arrayidx2 = getelementptr inbounds i32, i32* %C, i64 %i.037
-  %2 = load i32, i32* %arrayidx2, align 4
+  %arrayidx2 = getelementptr inbounds i32, ptr %C, i64 %i.037
+  %2 = load i32, ptr %arrayidx2, align 4
   %add3 = add nsw i32 %add, %2
-  %arrayidx4 = getelementptr inbounds i32, i32* %E, i64 %i.037
-  %3 = load i32, i32* %arrayidx4, align 4
+  %arrayidx4 = getelementptr inbounds i32, ptr %E, i64 %i.037
+  %3 = load i32, ptr %arrayidx4, align 4
   %add5 = add nsw i32 %add3, %3
-  %arrayidx6 = getelementptr inbounds i32, i32* %F, i64 %i.037
-  %4 = load i32, i32* %arrayidx6, align 4
+  %arrayidx6 = getelementptr inbounds i32, ptr %F, i64 %i.037
+  %4 = load i32, ptr %arrayidx6, align 4
   %add7 = add nsw i32 %add5, %4
-  %arrayidx8 = getelementptr inbounds i32, i32* %out, i64 %i.037
-  store i32 %add7, i32* %arrayidx8, align 4
-  %5 = load i32, i32* %arrayidx, align 4
-  %6 = load i32, i32* %arrayidx1, align 4
+  %arrayidx8 = getelementptr inbounds i32, ptr %out, i64 %i.037
+  store i32 %add7, ptr %arrayidx8, align 4
+  %5 = load i32, ptr %arrayidx, align 4
+  %6 = load i32, ptr %arrayidx1, align 4
   %add11 = add nsw i32 %6, %5
-  %7 = load i32, i32* %arrayidx2, align 4
+  %7 = load i32, ptr %arrayidx2, align 4
   %add13 = add nsw i32 %add11, %7
-  %8 = load i32, i32* %arrayidx4, align 4
+  %8 = load i32, ptr %arrayidx4, align 4
   %add15 = add nsw i32 %add13, %8
-  %9 = load i32, i32* %arrayidx6, align 4
+  %9 = load i32, ptr %arrayidx6, align 4
   %add17 = add nsw i32 %add15, %9
-  %arrayidx18 = getelementptr inbounds i32, i32* %out2, i64 %i.037
-  store i32 %add17, i32* %arrayidx18, align 4
+  %arrayidx18 = getelementptr inbounds i32, ptr %out2, i64 %i.037
+  store i32 %add17, ptr %arrayidx18, align 4
   %inc = add i64 %i.037, 1
   %exitcond = icmp eq i64 %inc, 256
   br i1 %exitcond, label %for.end, label %for.body

diff  --git a/llvm/test/LTO/X86/inline-asm-lto-discard.ll b/llvm/test/LTO/X86/inline-asm-lto-discard.ll
index 0b69a609f91fb..88492e4366489 100644
--- a/llvm/test/LTO/X86/inline-asm-lto-discard.ll
+++ b/llvm/test/LTO/X86/inline-asm-lto-discard.ll
@@ -64,7 +64,7 @@ target triple = "x86_64-unknown-linux-gnu"
 module asm ".weak foo"
 module asm ".equ foo,bar"
 
- at llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @bar to i8*)], section "llvm.metadata"
+ at llvm.compiler.used = appending global [1 x ptr] [ptr @bar], section "llvm.metadata"
 
 define internal i32 @bar(i32 %0) {
   %2 = add nsw i32 %0, 1

diff  --git a/llvm/test/LTO/X86/keep-used-puts-during-instcombine.ll b/llvm/test/LTO/X86/keep-used-puts-during-instcombine.ll
index 26249477ce24b..83345d43b88b0 100644
--- a/llvm/test/LTO/X86/keep-used-puts-during-instcombine.ll
+++ b/llvm/test/LTO/X86/keep-used-puts-during-instcombine.ll
@@ -4,33 +4,32 @@
 
 target triple = "x86_64-apple-darwin11"
 
- at llvm.compiler.used = appending global [1 x i8*] [
-  i8* bitcast (i32(i8*)* @puts to i8*)
+ at llvm.compiler.used = appending global [1 x ptr] [
+  ptr @puts
   ], section "llvm.metadata"
- at llvm.used = appending global [1 x i8*] [
-  i8* bitcast (i32(i32)* @uses_printf to i8*)
+ at llvm.used = appending global [1 x ptr] [
+  ptr @uses_printf
   ], section "llvm.metadata"
 
 @str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
 
 define i32 @uses_printf(i32 %i) {
 entry:
-  %s = getelementptr [13 x i8], [13 x i8]* @str, i64 0, i64 0
-  call i32 (i8*, ...) @printf(i8* %s)
+  call i32 (ptr, ...) @printf(ptr @str)
   ret i32 0
 }
 
-define internal i32 @printf(i8* readonly nocapture %fmt, ...) {
+define internal i32 @printf(ptr readonly nocapture %fmt, ...) {
 entry:
-  %ret = call i32 @bar(i8* %fmt)
+  %ret = call i32 @bar(ptr %fmt)
   ret i32 %ret
 }
 
 ; CHECK: define {{.*}} @puts(
-define internal i32 @puts(i8* %s) {
+define internal i32 @puts(ptr %s) {
 entry:
-  %ret = call i32 @bar(i8* %s)
+  %ret = call i32 @bar(ptr %s)
   ret i32 %ret
 }
 
-declare i32 @bar(i8*)
+declare i32 @bar(ptr)

diff  --git a/llvm/test/LTO/X86/libcall-overridden-via-alias.ll b/llvm/test/LTO/X86/libcall-overridden-via-alias.ll
index 04e1512f5b8cc..c8122c3039d76 100755
--- a/llvm/test/LTO/X86/libcall-overridden-via-alias.ll
+++ b/llvm/test/LTO/X86/libcall-overridden-via-alias.ll
@@ -51,13 +51,13 @@ target triple = "x86_64-unknown-linux-gnu"
 @src = global float 0x40091EB860000000, align 4
 @dst = common global float 0.000000e+00, align 4
 
- at logf = alias float (float), float (float)* @fname
+ at logf = alias float (float), ptr @fname
 
 define i32 @main() local_unnamed_addr {
 entry:
-  %0 = load volatile float, float* @src, align 4
+  %0 = load volatile float, ptr @src, align 4
   %1 = tail call float @llvm.log.f32(float %0)
-  store volatile float %1, float* @dst, align 4
+  store volatile float %1, ptr @dst, align 4
   ret i32 0
 }
 

diff  --git a/llvm/test/LTO/X86/linkonce_odr_func.ll b/llvm/test/LTO/X86/linkonce_odr_func.ll
index df81e06e935f3..3451a1196ff7f 100644
--- a/llvm/test/LTO/X86/linkonce_odr_func.ll
+++ b/llvm/test/LTO/X86/linkonce_odr_func.ll
@@ -44,11 +44,11 @@ define void @use() {
   call void @foo1()
   call void @foo2()
   call void @foo3()
-  %x1 = load i32, i32* @v1
-  %x2 = load i32, i32* @v2
-  %x3 = load i32, i32* @v3
-  %x4 = load i32, i32* @v4
-  %x5 = load i32, i32* @v5
-  %x6 = load i32, i32* @v6
+  %x1 = load i32, ptr @v1
+  %x2 = load i32, ptr @v2
+  %x3 = load i32, ptr @v3
+  %x4 = load i32, ptr @v4
+  %x5 = load i32, ptr @v5
+  %x6 = load i32, ptr @v6
   ret void
 }

diff  --git a/llvm/test/LTO/X86/no-undefined-puts-when-implemented.ll b/llvm/test/LTO/X86/no-undefined-puts-when-implemented.ll
index 34d2544db4528..0a5930ffbedb1 100644
--- a/llvm/test/LTO/X86/no-undefined-puts-when-implemented.ll
+++ b/llvm/test/LTO/X86/no-undefined-puts-when-implemented.ll
@@ -15,27 +15,26 @@ target triple = "x86_64-apple-darwin11"
 ; CHECK: T _uses_puts
 define i32 @uses_puts(i32 %i) {
 entry:
-  %s = call i8* @foo(i32 %i)
-  %ret = call i32 @puts(i8* %s)
+  %s = call ptr @foo(i32 %i)
+  %ret = call i32 @puts(ptr %s)
   ret i32 %ret
 }
 define i32 @uses_printf(i32 %i) {
 entry:
-  %s = getelementptr [13 x i8], [13 x i8]* @str, i64 0, i64 0
-  call i32 (i8*, ...) @printf(i8* %s)
+  call i32 (ptr, ...) @printf(ptr @str)
   ret i32 0
 }
 
-define hidden i32 @printf(i8* readonly nocapture %fmt, ...) {
+define hidden i32 @printf(ptr readonly nocapture %fmt, ...) {
 entry:
-  %ret = call i32 @bar(i8* %fmt)
+  %ret = call i32 @bar(ptr %fmt)
   ret i32 %ret
 }
-define hidden i32 @puts(i8* %s) {
+define hidden i32 @puts(ptr %s) {
 entry:
-  %ret = call i32 @bar(i8* %s)
+  %ret = call i32 @bar(ptr %s)
   ret i32 %ret
 }
 
-declare i8* @foo(i32)
-declare i32 @bar(i8*)
+declare ptr @foo(i32)
+declare i32 @bar(ptr)

diff  --git a/llvm/test/LTO/X86/objc-detection-i386.ll b/llvm/test/LTO/X86/objc-detection-i386.ll
index 18f2bd9ea1abb..58138686e6a37 100644
--- a/llvm/test/LTO/X86/objc-detection-i386.ll
+++ b/llvm/test/LTO/X86/objc-detection-i386.ll
@@ -12,36 +12,36 @@ module asm "\09.objc_category_name_A_foo=0"
 module asm "\09.globl .objc_category_name_A_foo"
 
 %0 = type opaque
-%struct._objc_method = type { i8*, i8*, i8* }
-%struct._objc_category = type { i8*, i8*, %struct._objc_method_list*, %struct._objc_method_list*, %struct._objc_protocol_list*, i32, %struct._prop_list_t*, %struct._prop_list_t* }
+%struct._objc_method = type { ptr, ptr, ptr }
+%struct._objc_category = type { ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr }
 %struct._objc_method_list = type opaque
-%struct._objc_protocol_list = type { %struct._objc_protocol_list*, i32, [0 x %struct._objc_protocol] }
-%struct._objc_protocol = type { %struct._objc_protocol_extension*, i8*, %struct._objc_protocol_list*, %struct._objc_method_description_list*, %struct._objc_method_description_list* }
-%struct._objc_protocol_extension = type { i32, %struct._objc_method_description_list*, %struct._objc_method_description_list*, %struct._prop_list_t*, i8**, %struct._prop_list_t* }
+%struct._objc_protocol_list = type { ptr, i32, [0 x %struct._objc_protocol] }
+%struct._objc_protocol = type { ptr, ptr, ptr, ptr, ptr }
+%struct._objc_protocol_extension = type { i32, ptr, ptr, ptr, ptr, ptr }
 %struct._objc_method_description_list = type { i32, [0 x %struct._objc_method_description] }
-%struct._objc_method_description = type { i8*, i8* }
+%struct._objc_method_description = type { ptr, ptr }
 %struct._prop_list_t = type { i32, i32, [0 x %struct._prop_t] }
-%struct._prop_t = type { i8*, i8* }
-%struct._objc_module = type { i32, i32, i8*, %struct._objc_symtab* }
-%struct._objc_symtab = type { i32, i8*, i16, i16, [0 x i8*] }
+%struct._prop_t = type { ptr, ptr }
+%struct._objc_module = type { i32, i32, ptr, ptr }
+%struct._objc_symtab = type { i32, ptr, i16, i16, [0 x ptr] }
 
 @OBJC_METH_VAR_NAME_ = private global [12 x i8] c"foo_myStuff\00", section "__TEXT,__cstring,cstring_literals", align 1
 @OBJC_METH_VAR_TYPE_ = private global [7 x i8] c"v8 at 0:4\00", section "__TEXT,__cstring,cstring_literals", align 1
 @OBJC_CLASS_NAME_ = private global [4 x i8] c"foo\00", section "__TEXT,__cstring,cstring_literals", align 1
 @OBJC_CLASS_NAME_.1 = private global [2 x i8] c"A\00", section "__TEXT,__cstring,cstring_literals", align 1
- at OBJC_CATEGORY_INSTANCE_METHODS_A_foo = private global { i8*, i32, [1 x %struct._objc_method] } { i8* null, i32 1, [1 x %struct._objc_method] [%struct._objc_method { i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast (void (%0*, i8*)* @"\01-[A(foo) foo_myStuff]" to i8*) }] }, section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4
- at OBJC_CATEGORY_A_foo = private global %struct._objc_category { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @OBJC_CLASS_NAME_.1, i32 0, i32 0), %struct._objc_method_list* bitcast ({ i8*, i32, [1 x %struct._objc_method] }* @OBJC_CATEGORY_INSTANCE_METHODS_A_foo to %struct._objc_method_list*), %struct._objc_method_list* null, %struct._objc_protocol_list* null, i32 32, %struct._prop_list_t* null, %struct._prop_list_t* null }, section "__OBJC,__category,regular,no_dead_strip", align 4
+ at OBJC_CATEGORY_INSTANCE_METHODS_A_foo = private global { ptr, i32, [1 x %struct._objc_method] } { ptr null, i32 1, [1 x %struct._objc_method] [%struct._objc_method { ptr @OBJC_METH_VAR_NAME_, ptr @OBJC_METH_VAR_TYPE_, ptr @"\01-[A(foo) foo_myStuff]" }] }, section "__OBJC,__cat_inst_meth,regular,no_dead_strip", align 4
+ at OBJC_CATEGORY_A_foo = private global %struct._objc_category { ptr @OBJC_CLASS_NAME_, ptr @OBJC_CLASS_NAME_.1, ptr @OBJC_CATEGORY_INSTANCE_METHODS_A_foo, ptr null, ptr null, i32 32, ptr null, ptr null }, section "__OBJC,__category,regular,no_dead_strip", align 4
 @OBJC_CLASS_NAME_.2 = private global [1 x i8] zeroinitializer, section "__TEXT,__cstring,cstring_literals", align 1
- at OBJC_SYMBOLS = private global { i32, i8*, i16, i16, [1 x i8*] } { i32 0, i8* null, i16 0, i16 1, [1 x i8*] [i8* bitcast (%struct._objc_category* @OBJC_CATEGORY_A_foo to i8*)] }, section "__OBJC,__symbols,regular,no_dead_strip", align 4
- at OBJC_MODULES = private global %struct._objc_module { i32 7, i32 16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @OBJC_CLASS_NAME_.2, i32 0, i32 0), %struct._objc_symtab* bitcast ({ i32, i8*, i16, i16, [1 x i8*] }* @OBJC_SYMBOLS to %struct._objc_symtab*) }, section "__OBJC,__module_info,regular,no_dead_strip", align 4
- at llvm.compiler.used = appending global [9 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @OBJC_CLASS_NAME_.1, i32 0, i32 0), i8* bitcast ({ i8*, i32, [1 x %struct._objc_method] }* @OBJC_CATEGORY_INSTANCE_METHODS_A_foo to i8*), i8* bitcast (%struct._objc_category* @OBJC_CATEGORY_A_foo to i8*), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @OBJC_CLASS_NAME_.2, i32 0, i32 0), i8* bitcast ({ i32, i8*, i16, i16, [1 x i8*] }* @OBJC_SYMBOLS to i8*), i8* bitcast (%struct._objc_module* @OBJC_MODULES to i8*)], section "llvm.metadata"
+ at OBJC_SYMBOLS = private global { i32, ptr, i16, i16, [1 x ptr] } { i32 0, ptr null, i16 0, i16 1, [1 x ptr] [ptr @OBJC_CATEGORY_A_foo] }, section "__OBJC,__symbols,regular,no_dead_strip", align 4
+ at OBJC_MODULES = private global %struct._objc_module { i32 7, i32 16, ptr @OBJC_CLASS_NAME_.2, ptr @OBJC_SYMBOLS }, section "__OBJC,__module_info,regular,no_dead_strip", align 4
+ at llvm.compiler.used = appending global [9 x ptr] [ptr @OBJC_METH_VAR_NAME_, ptr @OBJC_METH_VAR_TYPE_, ptr @OBJC_CLASS_NAME_, ptr @OBJC_CLASS_NAME_.1, ptr @OBJC_CATEGORY_INSTANCE_METHODS_A_foo, ptr @OBJC_CATEGORY_A_foo, ptr @OBJC_CLASS_NAME_.2, ptr @OBJC_SYMBOLS, ptr @OBJC_MODULES], section "llvm.metadata"
 
 ; Function Attrs: nounwind ssp
-define internal void @"\01-[A(foo) foo_myStuff]"(%0*, i8*) #0 {
-  %3 = alloca %0*, align 4
-  %4 = alloca i8*, align 4
-  store %0* %0, %0** %3, align 4
-  store i8* %1, i8** %4, align 4
+define internal void @"\01-[A(foo) foo_myStuff]"(ptr, ptr) #0 {
+  %3 = alloca ptr, align 4
+  %4 = alloca ptr, align 4
+  store ptr %0, ptr %3, align 4
+  store ptr %1, ptr %4, align 4
   ret void
 }
 

diff  --git a/llvm/test/LTO/X86/objc-detection.ll b/llvm/test/LTO/X86/objc-detection.ll
index 6e96b9b43d63a..0aae9314d3485 100644
--- a/llvm/test/LTO/X86/objc-detection.ll
+++ b/llvm/test/LTO/X86/objc-detection.ll
@@ -7,34 +7,34 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 target triple = "x86_64-apple-macosx10.12.0"
 
 %0 = type opaque
-%struct._class_t = type { %struct._class_t*, %struct._class_t*, %struct._objc_cache*, i8* (i8*, i8*)**, %struct._class_ro_t* }
+%struct._class_t = type { ptr, ptr, ptr, ptr, ptr }
 %struct._objc_cache = type opaque
-%struct._class_ro_t = type { i32, i32, i32, i8*, i8*, %struct.__method_list_t*, %struct._objc_protocol_list*, %struct._ivar_list_t*, i8*, %struct._prop_list_t* }
+%struct._class_ro_t = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
 %struct.__method_list_t = type { i32, i32, [0 x %struct._objc_method] }
-%struct._objc_method = type { i8*, i8*, i8* }
-%struct._objc_protocol_list = type { i64, [0 x %struct._protocol_t*] }
-%struct._protocol_t = type { i8*, i8*, %struct._objc_protocol_list*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct._prop_list_t*, i32, i32, i8**, i8*, %struct._prop_list_t* }
+%struct._objc_method = type { ptr, ptr, ptr }
+%struct._objc_protocol_list = type { i64, [0 x ptr] }
+%struct._protocol_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, ptr }
 %struct._ivar_list_t = type { i32, i32, [0 x %struct._ivar_t] }
-%struct._ivar_t = type { i64*, i8*, i8*, i32, i32 }
+%struct._ivar_t = type { ptr, ptr, ptr, i32, i32 }
 %struct._prop_list_t = type { i32, i32, [0 x %struct._prop_t] }
-%struct._prop_t = type { i8*, i8* }
-%struct._category_t = type { i8*, %struct._class_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct._objc_protocol_list*, %struct._prop_list_t*, %struct._prop_list_t*, i32 }
+%struct._prop_t = type { ptr, ptr }
+%struct._category_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
 
 @OBJC_CLASS_NAME_ = private global [4 x i8] c"foo\00", section "__TEXT,__objc_classname,cstring_literals", align 1
 @"OBJC_CLASS_$_A" = external global %struct._class_t
 @OBJC_METH_VAR_NAME_ = private global [12 x i8] c"foo_myStuff\00", section "__TEXT,__objc_methname,cstring_literals", align 1
 @OBJC_METH_VAR_TYPE_ = private global [8 x i8] c"v16 at 0:8\00", section "__TEXT,__objc_methtype,cstring_literals", align 1
-@"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_foo" = private global { i32, i32, [1 x %struct._objc_method] } { i32 24, i32 1, [1 x %struct._objc_method] [%struct._objc_method { i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast (void (%0*, i8*)* @"\01-[A(foo) foo_myStuff]" to i8*) }] }, section "__DATA, __objc_const", align 8
-@"\01l_OBJC_$_CATEGORY_A_$_foo" = private global %struct._category_t { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), %struct._class_t* @"OBJC_CLASS_$_A", %struct.__method_list_t* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_foo" to %struct.__method_list_t*), %struct.__method_list_t* null, %struct._objc_protocol_list* null, %struct._prop_list_t* null, %struct._prop_list_t* null, i32 64 }, section "__DATA, __objc_const", align 8
-@"OBJC_LABEL_CATEGORY_$" = private global [1 x i8*] [i8* bitcast (%struct._category_t* @"\01l_OBJC_$_CATEGORY_A_$_foo" to i8*)], section "__DATA, __objc_catlist, regular, no_dead_strip", align 8
- at llvm.compiler.used = appending global [6 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_foo" to i8*), i8* bitcast (%struct._category_t* @"\01l_OBJC_$_CATEGORY_A_$_foo" to i8*), i8* bitcast ([1 x i8*]* @"OBJC_LABEL_CATEGORY_$" to i8*)], section "llvm.metadata"
+@"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_foo" = private global { i32, i32, [1 x %struct._objc_method] } { i32 24, i32 1, [1 x %struct._objc_method] [%struct._objc_method { ptr @OBJC_METH_VAR_NAME_, ptr @OBJC_METH_VAR_TYPE_, ptr @"\01-[A(foo) foo_myStuff]" }] }, section "__DATA, __objc_const", align 8
+@"\01l_OBJC_$_CATEGORY_A_$_foo" = private global %struct._category_t { ptr @OBJC_CLASS_NAME_, ptr @"OBJC_CLASS_$_A", ptr @"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_foo", ptr null, ptr null, ptr null, ptr null, i32 64 }, section "__DATA, __objc_const", align 8
+@"OBJC_LABEL_CATEGORY_$" = private global [1 x ptr] [ptr @"\01l_OBJC_$_CATEGORY_A_$_foo"], section "__DATA, __objc_catlist, regular, no_dead_strip", align 8
+ at llvm.compiler.used = appending global [6 x ptr] [ptr @OBJC_CLASS_NAME_, ptr @OBJC_METH_VAR_NAME_, ptr @OBJC_METH_VAR_TYPE_, ptr @"\01l_OBJC_$_CATEGORY_INSTANCE_METHODS_A_$_foo", ptr @"\01l_OBJC_$_CATEGORY_A_$_foo", ptr @"OBJC_LABEL_CATEGORY_$"], section "llvm.metadata"
 
 ; Function Attrs: ssp uwtable
-define internal void @"\01-[A(foo) foo_myStuff]"(%0*, i8*) #0 {
-  %3 = alloca %0*, align 8
-  %4 = alloca i8*, align 8
-  store %0* %0, %0** %3, align 8
-  store i8* %1, i8** %4, align 8
+define internal void @"\01-[A(foo) foo_myStuff]"(ptr, ptr) #0 {
+  %3 = alloca ptr, align 8
+  %4 = alloca ptr, align 8
+  store ptr %0, ptr %3, align 8
+  store ptr %1, ptr %4, align 8
   ret void
 }
 

diff  --git a/llvm/test/LTO/X86/pr38046.ll b/llvm/test/LTO/X86/pr38046.ll
index be5b88c592a84..8f04190f0c83f 100644
--- a/llvm/test/LTO/X86/pr38046.ll
+++ b/llvm/test/LTO/X86/pr38046.ll
@@ -11,7 +11,7 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
 target triple = "x86_64-unknown-linux-gnu"
 
 define i32 @foo() {
-  call void @llvm.dbg.value(metadata i32 ()* @get, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !6)
+  call void @llvm.dbg.value(metadata ptr @get, metadata !7, metadata !DIExpression()), !dbg !DILocation(scope: !6)
   ret i32 0
 }
 

diff  --git a/llvm/test/LTO/X86/remangle_intrinsics.ll b/llvm/test/LTO/X86/remangle_intrinsics.ll
index ffeb92be09628..038d24e2ddd38 100644
--- a/llvm/test/LTO/X86/remangle_intrinsics.ll
+++ b/llvm/test/LTO/X86/remangle_intrinsics.ll
@@ -14,9 +14,9 @@ target triple = "x86_64-unknown-linux-gnu"
 
 %struct.rtx_def = type { i16 }
 
-define void @foo(%struct.rtx_def* %a, i8 %b, i32 %c) {
-  call void  @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def* align 4 %a, i8 %b, i32 %c, i1 true)
+define void @foo(ptr %a, i8 %b, i32 %c) {
+  call void  @llvm.memset.p0.rtx_def.i32(ptr align 4 %a, i8 %b, i32 %c, i1 true)
   ret void
 }
 
-declare void @llvm.memset.p0struct.rtx_def.i32(%struct.rtx_def*, i8, i32, i1)
+declare void @llvm.memset.p0.rtx_def.i32(ptr, i8, i32, i1)

diff  --git a/llvm/test/LTO/X86/set-merged.ll b/llvm/test/LTO/X86/set-merged.ll
index 56cbb4b2dce31..ac19d3d13008f 100644
--- a/llvm/test/LTO/X86/set-merged.ll
+++ b/llvm/test/LTO/X86/set-merged.ll
@@ -10,9 +10,9 @@ target triple = "x86_64-apple-macosx10.10.0"
 define i32 @_Z3fooi(i32 %a) {
 entry:
   %a.addr = alloca i32, align 4
-  store i32 %a, i32* %a.addr, align 4
-  %0 = load i32, i32* %a.addr, align 4
-  %1 = load i32, i32* %a.addr, align 4
+  store i32 %a, ptr %a.addr, align 4
+  %0 = load i32, ptr %a.addr, align 4
+  %1 = load i32, ptr %a.addr, align 4
   %call = call i32 @_Z4bar2i(i32 %1)
   %add = add nsw i32 %0, %call
   ret i32 %add
@@ -21,8 +21,8 @@ entry:
 define i32 @_Z4bar2i(i32 %a) {
 entry:
   %a.addr = alloca i32, align 4
-  store i32 %a, i32* %a.addr, align 4
-  %0 = load i32, i32* %a.addr, align 4
+  store i32 %a, ptr %a.addr, align 4
+  %0 = load i32, ptr %a.addr, align 4
   %mul = mul nsw i32 2, %0
   ret i32 %mul
 }
@@ -30,7 +30,7 @@ entry:
 define i32 @main() {
 entry:
   %retval = alloca i32, align 4
-  store i32 0, i32* %retval
+  store i32 0, ptr %retval
   %call = call i32 @_Z3fooi(i32 44)
   ret i32 %call
 }

diff  --git a/llvm/test/LTO/X86/stdcall.ll b/llvm/test/LTO/X86/stdcall.ll
index f7800d0212f0e..5f95a0e864fad 100644
--- a/llvm/test/LTO/X86/stdcall.ll
+++ b/llvm/test/LTO/X86/stdcall.ll
@@ -5,6 +5,6 @@ target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
 target triple = "i386-pc-windows-msvc19.0.23918"
 
 ; CHECK: .globl _DllMain at 12
-define x86_stdcallcc i32 @DllMain(i8* %module, i32 %reason, i8* %reserved) {
+define x86_stdcallcc i32 @DllMain(ptr %module, i32 %reason, ptr %reserved) {
   ret i32 1
 }

diff  --git a/llvm/test/LTO/X86/symver-asm.ll b/llvm/test/LTO/X86/symver-asm.ll
index 0cb3d661d0395..912fffe8b2cbb 100644
--- a/llvm/test/LTO/X86/symver-asm.ll
+++ b/llvm/test/LTO/X86/symver-asm.ll
@@ -17,7 +17,7 @@ module asm ".symver foo,foo@@VER1"
 
 ; Local values used in inline assembly must be specified on the
 ; llvm.compiler.used so they aren't incorrectly DCE'd during module linking.
- at llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @io_cancel_local_0_4 to i8*)], section "llvm.metadata"
+ at llvm.compiler.used = appending global [1 x ptr] [ptr @io_cancel_local_0_4], section "llvm.metadata"
 
 define i32 @io_cancel_0_4() {
 ; CHECK-DAG: T io_cancel@@LIBAIO_0.4

diff  --git a/llvm/test/LTO/X86/tli-nobuiltin.ll b/llvm/test/LTO/X86/tli-nobuiltin.ll
index 1b8fb4b48e564..e1301a39a0510 100644
--- a/llvm/test/LTO/X86/tli-nobuiltin.ll
+++ b/llvm/test/LTO/X86/tli-nobuiltin.ll
@@ -31,7 +31,7 @@
 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.11.0"
 
-declare i32 @fprintf(%FILE*, i8*, ...)
+declare i32 @fprintf(ptr, ptr, ...)
 
 %FILE = type { }
 
@@ -40,9 +40,7 @@ declare i32 @fprintf(%FILE*, i8*, ...)
 
 ; Check fprintf(fp, "%s", str) -> fwrite(str, fp) only when builtins are enabled
 
-define void @foo(%FILE* %fp) {
-  %fmt = getelementptr [3 x i8], [3 x i8]* @percent_s, i32 0, i32 0
-  %str = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
-  call i32 (%FILE*, i8*, ...) @fprintf(%FILE* %fp, i8* %fmt, i8* %str)
+define void @foo(ptr %fp) {
+  call i32 (ptr, ptr, ...) @fprintf(ptr %fp, ptr @percent_s, ptr @hello_world)
   ret void
 }

diff  --git a/llvm/test/LTO/X86/triple-init2.ll b/llvm/test/LTO/X86/triple-init2.ll
index 9e91498478cbd..2638180ef33c6 100644
--- a/llvm/test/LTO/X86/triple-init2.ll
+++ b/llvm/test/LTO/X86/triple-init2.ll
@@ -18,7 +18,7 @@
 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc19.11.0"
 
-define dso_local i32 @main(i32 %argc, i8** nocapture readnone %argv) local_unnamed_addr {
+define dso_local i32 @main(i32 %argc, ptr nocapture readnone %argv) local_unnamed_addr {
 entry:
   %conv = sitofp i32 %argc to float
   %exp2 = tail call float @llvm.exp2.f32(float %conv)

diff  --git a/llvm/test/LTO/X86/type-mapping-bug.ll b/llvm/test/LTO/X86/type-mapping-bug.ll
index 095e7cf1f8818..426565e4583f7 100644
--- a/llvm/test/LTO/X86/type-mapping-bug.ll
+++ b/llvm/test/LTO/X86/type-mapping-bug.ll
@@ -11,11 +11,11 @@ target triple = "x86_64-pc-windows-msvc18.0.0"
 %CommonStruct = type { i32 }
 ; The Src module will re-use our DINode for this type.
 %Tricky = type opaque
-%Tricky.1 = type { %DstType* }
+%Tricky.1 = type { ptr }
 
 @x = global %DstType zeroinitializer
 @foo = internal global %CommonStruct zeroinitializer, !dbg !0
-; That DINode will refer to this value, casted to %Tricky.1* (!11),
+; That DINode will refer to this value, casted to ptr (!11),
 ; which will then show up in Src's getIdentifiedStructTypes().
 @templateValueParam = global i8 0
 ; Because of the names, we would try to map %Tricky.1 to %Tricky --
@@ -24,7 +24,7 @@ target triple = "x86_64-pc-windows-msvc18.0.0"
 ; a destination type. Since these types are not in the source module,
 ; there should be no attempt to create a mapping involving them;
 ; both types should be left as they are.
- at use = global %Tricky* null
+ at use = global ptr null
 
 ; Mark %Tricky used.
 !llvm.dbg.cu = !{!2}
@@ -41,7 +41,7 @@ target triple = "x86_64-pc-windows-msvc18.0.0"
 !8 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !6, baseType: !9)
 !9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Template<&x>", file: !3, line: 3, size: 8, elements: !4, templateParams: !10, identifier: ".?AU?$Template@$1?x@@3UX@@A@@")
 !10 = !{!11}
-!11 = !DITemplateValueParameter(type: !12, value: %Tricky.1* bitcast (i8* @templateValueParam to %Tricky.1*))
+!11 = !DITemplateValueParameter(type: !12, value: ptr @templateValueParam)
 !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64)
 !13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "X", file: !3, line: 1, size: 8, elements: !4, identifier: ".?AUX@@")
 !14 = !{i32 2, !"Debug Info Version", i32 3}

diff  --git a/llvm/test/LTO/X86/type-mapping-bug2.ll b/llvm/test/LTO/X86/type-mapping-bug2.ll
index 967b68fa3ebb8..8d3a3ac5d6deb 100644
--- a/llvm/test/LTO/X86/type-mapping-bug2.ll
+++ b/llvm/test/LTO/X86/type-mapping-bug2.ll
@@ -16,7 +16,7 @@ define %"T1" @a() {
   unreachable
 }
 
-define i1 @b(%"T2"*) {
+define i1 @b(ptr) {
   unreachable
 }
 
@@ -32,7 +32,7 @@ define i1 @b(%"T2"*) {
 
 ; The reference to @b and T2 that will be loaded in %t0.o
 
-!7 = !DITemplateValueParameter(value: i1 (%"T2"*)* @b)
+!7 = !DITemplateValueParameter(value: ptr @b)
 !8 = distinct !DISubprogram(unit: !2)
 
 ; This DICompositeType is uniqued against !5 in Inputs/type-mapping-bug2.ll,

diff  --git a/llvm/test/LTO/X86/type-mapping-bug3.ll b/llvm/test/LTO/X86/type-mapping-bug3.ll
index 6d9e81d6cdcdd..8ea147e6fb974 100644
--- a/llvm/test/LTO/X86/type-mapping-bug3.ll
+++ b/llvm/test/LTO/X86/type-mapping-bug3.ll
@@ -9,7 +9,7 @@ target triple = "x86_64-unknown-linux-gnu"
 
 ; T2 is the non-opaque struct required to trigger the uniqued T2.0 and T3.0 to
 ; respectively T2 and T3 in the destination module.
-%"T2" = type { %"T3"* }
+%"T2" = type { ptr }
 %"T3" = type opaque
 
 ; Use/refer to T2 so it gets added as an IdentifiedStructType.
@@ -19,14 +19,14 @@ define void @c(%"T2") {
 
 ; The global declaration that causes the assertion when its type is mapped to
 ; itself incorrectly.
-declare void @d(%"T3"*)
+declare void @d(ptr)
 
 define void @b() {
 entry:
-  %f.addr = alloca %"T3"*load %"T3"*, %"T3"** %f.addr
+  %f.addr = alloca ptr load ptr, ptr %f.addr
 
   ; The call with the getCalledOperand() vs getCalledFunction() mismatch.
-  call void @d(%"T3"* %0)
+  call void @d(ptr %0)
   unreachable
 }
 
@@ -44,4 +44,4 @@ entry:
 !6 = !{!7}
 
 ; The reference to d and T3 that gets loaded into %t0.o
-!7 = !DITemplateValueParameter(value: void (%"T3"*)* @d)
+!7 = !DITemplateValueParameter(value: ptr @d)

diff  --git a/llvm/test/LTO/X86/unnamed.ll b/llvm/test/LTO/X86/unnamed.ll
index ad410f58eb6ef..e12e0a3820b6d 100644
--- a/llvm/test/LTO/X86/unnamed.ll
+++ b/llvm/test/LTO/X86/unnamed.ll
@@ -7,4 +7,4 @@
 target triple = "x86_64-unknown-linux-gnu"
 
 @0 = private global i32 42
- at foo = constant i32* @0
+ at foo = constant ptr @0


        


More information about the llvm-commits mailing list