[llvm] fa8448c - [NewGVN] Convert some tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 4 07:45:09 PST 2023
Author: Nikita Popov
Date: 2023-01-04T16:44:50+01:00
New Revision: fa8448c1b18bfe7ffa89f91ab0cfc16f2f83760d
URL: https://github.com/llvm/llvm-project/commit/fa8448c1b18bfe7ffa89f91ab0cfc16f2f83760d
DIFF: https://github.com/llvm/llvm-project/commit/fa8448c1b18bfe7ffa89f91ab0cfc16f2f83760d.diff
LOG: [NewGVN] Convert some tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/Transforms/NewGVN/2007-07-25-DominatedLoop.ll
llvm/test/Transforms/NewGVN/2007-07-25-InfiniteLoop.ll
llvm/test/Transforms/NewGVN/2007-07-25-Loop.ll
llvm/test/Transforms/NewGVN/2007-07-25-NestedLoop.ll
llvm/test/Transforms/NewGVN/2007-07-25-SinglePredecessor.ll
llvm/test/Transforms/NewGVN/2007-07-26-NonRedundant.ll
llvm/test/Transforms/NewGVN/2007-07-26-PhiErasure.ll
llvm/test/Transforms/NewGVN/2007-07-30-PredIDom.ll
llvm/test/Transforms/NewGVN/2007-07-31-NoDomInherit-xfail.ll
llvm/test/Transforms/NewGVN/2007-07-31-RedundantPhi.ll
llvm/test/Transforms/NewGVN/2008-02-12-UndefLoad-xfail.ll
llvm/test/Transforms/NewGVN/2008-02-13-NewPHI.ll
llvm/test/Transforms/NewGVN/2008-07-02-Unreachable.ll
llvm/test/Transforms/NewGVN/2008-12-09-SelfRemove.ll
llvm/test/Transforms/NewGVN/2008-12-12-RLE-Crash.ll
llvm/test/Transforms/NewGVN/2008-12-14-rle-reanalyze.ll
llvm/test/Transforms/NewGVN/2008-12-15-CacheVisited.ll
llvm/test/Transforms/NewGVN/2009-01-21-SortInvalidation.ll
llvm/test/Transforms/NewGVN/2009-01-22-SortInvalidation.ll
llvm/test/Transforms/NewGVN/2009-03-10-PREOnVoid.ll
llvm/test/Transforms/NewGVN/2009-07-13-MemDepSortFail.ll
llvm/test/Transforms/NewGVN/2009-11-12-MemDepMallocBitCast.ll
llvm/test/Transforms/NewGVN/2010-03-31-RedundantPHIs.ll
llvm/test/Transforms/NewGVN/2010-05-08-OneBit.ll
llvm/test/Transforms/NewGVN/2011-04-27-phioperands.ll
llvm/test/Transforms/NewGVN/2011-09-07-TypeIdFor.ll
llvm/test/Transforms/NewGVN/2016-08-30-MaskedScatterGather-xfail-inseltpoison.ll
llvm/test/Transforms/NewGVN/2016-08-30-MaskedScatterGather-xfail.ll
llvm/test/Transforms/NewGVN/MemdepMiscompile.ll
llvm/test/Transforms/NewGVN/addrspacecast.ll
llvm/test/Transforms/NewGVN/assume-equal-xfail.ll
llvm/test/Transforms/NewGVN/assume-equal.ll
llvm/test/Transforms/NewGVN/basic-cyclic-opt.ll
llvm/test/Transforms/NewGVN/basic-undef-test.ll
llvm/test/Transforms/NewGVN/big-endian.ll
llvm/test/Transforms/NewGVN/bitcast-of-call.ll
llvm/test/Transforms/NewGVN/calloc-load-removal.ll
llvm/test/Transforms/NewGVN/calls-nonlocal-xfail.ll
llvm/test/Transforms/NewGVN/calls-readonly.ll
llvm/test/Transforms/NewGVN/completeness.ll
llvm/test/Transforms/NewGVN/cond_br.ll
llvm/test/Transforms/NewGVN/cond_br2-xfail.ll
llvm/test/Transforms/NewGVN/condprop-xfail.ll
llvm/test/Transforms/NewGVN/crash-no-aa.ll
llvm/test/Transforms/NewGVN/crash.ll
llvm/test/Transforms/NewGVN/cyclic-phi-handling.ll
llvm/test/Transforms/NewGVN/dbg-redundant-load.ll
llvm/test/Transforms/NewGVN/deadstore.ll
llvm/test/Transforms/NewGVN/debugloc-xfail.ll
llvm/test/Transforms/NewGVN/edge.ll
llvm/test/Transforms/NewGVN/eliminate-ssacopy.ll
llvm/test/Transforms/NewGVN/equivalent-phi.ll
llvm/test/Transforms/NewGVN/fence-xfail.ll
llvm/test/Transforms/NewGVN/flags-simplify.ll
llvm/test/Transforms/NewGVN/fold-const-expr.ll
llvm/test/Transforms/NewGVN/funclet.ll
llvm/test/Transforms/NewGVN/int_sideeffect.ll
llvm/test/Transforms/NewGVN/invariant.group.ll
llvm/test/Transforms/NewGVN/invariant.start.ll
llvm/test/Transforms/NewGVN/lifetime-simple.ll
llvm/test/Transforms/NewGVN/load-constant-mem.ll
llvm/test/Transforms/NewGVN/load-from-unreachable-predecessor.ll
llvm/test/Transforms/NewGVN/loadforward.ll
llvm/test/Transforms/NewGVN/malloc-load-removal.ll
llvm/test/Transforms/NewGVN/memory-handling.ll
llvm/test/Transforms/NewGVN/metadata-nonnull.ll
llvm/test/Transforms/NewGVN/metadata-simplify.ll
llvm/test/Transforms/NewGVN/noalias.ll
llvm/test/Transforms/NewGVN/non-integral-pointers.ll
llvm/test/Transforms/NewGVN/nonescaping-malloc-xfail.ll
llvm/test/Transforms/NewGVN/null-aliases-nothing.ll
llvm/test/Transforms/NewGVN/opt-remarks-xfail.ll
llvm/test/Transforms/NewGVN/phi-of-ops-loads.ll
llvm/test/Transforms/NewGVN/phi-of-ops-move-block.ll
llvm/test/Transforms/NewGVN/phi-of-ops-simplification-dependencies.ll
llvm/test/Transforms/NewGVN/phi-translate-partial-alias.ll
llvm/test/Transforms/NewGVN/pr10820-xfail.ll
llvm/test/Transforms/NewGVN/pr14166-xfail.ll
llvm/test/Transforms/NewGVN/pr17732.ll
llvm/test/Transforms/NewGVN/pr17852.ll
llvm/test/Transforms/NewGVN/pr24397.ll
llvm/test/Transforms/NewGVN/pr24426.ll
llvm/test/Transforms/NewGVN/pr25440.ll
llvm/test/Transforms/NewGVN/pr28562.ll
llvm/test/Transforms/NewGVN/pr31472.ll
llvm/test/Transforms/NewGVN/pr31483.ll
llvm/test/Transforms/NewGVN/pr31491.ll
llvm/test/Transforms/NewGVN/pr31501.ll
llvm/test/Transforms/NewGVN/pr31573.ll
llvm/test/Transforms/NewGVN/pr31594.ll
llvm/test/Transforms/NewGVN/pr31613_2.ll
llvm/test/Transforms/NewGVN/pr31682.ll
llvm/test/Transforms/NewGVN/pr31758.ll
llvm/test/Transforms/NewGVN/pr32607.ll
llvm/test/Transforms/NewGVN/pr32836.ll
llvm/test/Transforms/NewGVN/pr32838.ll
llvm/test/Transforms/NewGVN/pr32845.ll
llvm/test/Transforms/NewGVN/pr32852.ll
llvm/test/Transforms/NewGVN/pr32897.ll
llvm/test/Transforms/NewGVN/pr32934.ll
llvm/test/Transforms/NewGVN/pr32945.ll
llvm/test/Transforms/NewGVN/pr32952.ll
llvm/test/Transforms/NewGVN/pr33014.ll
llvm/test/Transforms/NewGVN/pr33086.ll
llvm/test/Transforms/NewGVN/pr33116.ll
llvm/test/Transforms/NewGVN/pr33185.ll
llvm/test/Transforms/NewGVN/pr33187.ll
llvm/test/Transforms/NewGVN/pr33196.ll
llvm/test/Transforms/NewGVN/pr33204.ll
llvm/test/Transforms/NewGVN/pr33305.ll
llvm/test/Transforms/NewGVN/pr33367.ll
llvm/test/Transforms/NewGVN/pr33432.ll
llvm/test/Transforms/NewGVN/pr33461.ll
llvm/test/Transforms/NewGVN/pr33720.ll
llvm/test/Transforms/NewGVN/pr34452.ll
llvm/test/Transforms/NewGVN/pr35125.ll
llvm/test/Transforms/NewGVN/pr37121-seens-this-value-a-lot.ll
llvm/test/Transforms/NewGVN/pre-compare.ll
llvm/test/Transforms/NewGVN/pre-new-inst-xfail.ll
llvm/test/Transforms/NewGVN/predicates.ll
llvm/test/Transforms/NewGVN/preserve-metadata-for-predicate-replacements.ll
llvm/test/Transforms/NewGVN/propagate-ir-flags.ll
llvm/test/Transforms/NewGVN/range.ll
llvm/test/Transforms/NewGVN/readattrs.ll
llvm/test/Transforms/NewGVN/rle-must-alias-xfail.ll
llvm/test/Transforms/NewGVN/rle-no-phi-translate-xfail.ll
llvm/test/Transforms/NewGVN/rle-nonlocal.ll
llvm/test/Transforms/NewGVN/rle.ll
llvm/test/Transforms/NewGVN/simp-to-self.ll
llvm/test/Transforms/NewGVN/sq-ctxi.ll
llvm/test/Transforms/NewGVN/stale-loop-info.ll
llvm/test/Transforms/NewGVN/storeoverstore.ll
llvm/test/Transforms/NewGVN/tbaa.ll
llvm/test/Transforms/NewGVN/verify-memoryphi.ll
llvm/test/Transforms/NewGVN/volatile-nonvolatile.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/NewGVN/2007-07-25-DominatedLoop.ll b/llvm/test/Transforms/NewGVN/2007-07-25-DominatedLoop.ll
index 22951d75605d..978f061ac4fd 100644
--- a/llvm/test/Transforms/NewGVN/2007-07-25-DominatedLoop.ll
+++ b/llvm/test/Transforms/NewGVN/2007-07-25-DominatedLoop.ll
@@ -1,9 +1,9 @@
; RUN: opt < %s -passes=newgvn | llvm-dis
%struct.PerlInterpreter = type { i8 }
- at PL_sv_count = external global i32 ; <i32*> [#uses=2]
+ at PL_sv_count = external global i32 ; <ptr> [#uses=2]
-define void @perl_destruct(%struct.PerlInterpreter* %sv_interp) {
+define void @perl_destruct(ptr %sv_interp) {
entry:
br i1 false, label %cond_next25, label %cond_true16
@@ -71,11 +71,11 @@ cond_true23.i: ; preds = %Perl_safefree.exit68
ret void
cond_next150: ; preds = %Perl_safefree.exit68
- %tmp16092 = load i32, i32* @PL_sv_count, align 4 ; <i32> [#uses=0]
+ %tmp16092 = load i32, ptr @PL_sv_count, align 4 ; <i32> [#uses=0]
br label %cond_next165
bb157: ; preds = %cond_next165
- %tmp158 = load i32, i32* @PL_sv_count, align 4 ; <i32> [#uses=0]
+ %tmp158 = load i32, ptr @PL_sv_count, align 4 ; <i32> [#uses=0]
br label %cond_next165
cond_next165: ; preds = %bb157, %cond_next150
diff --git a/llvm/test/Transforms/NewGVN/2007-07-25-InfiniteLoop.ll b/llvm/test/Transforms/NewGVN/2007-07-25-InfiniteLoop.ll
index dd3bd4cd07de..abb6fbe5030f 100644
--- a/llvm/test/Transforms/NewGVN/2007-07-25-InfiniteLoop.ll
+++ b/llvm/test/Transforms/NewGVN/2007-07-25-InfiniteLoop.ll
@@ -1,15 +1,15 @@
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
%struct.INT2 = type { i32, i32 }
- at blkshifts = external global %struct.INT2* ; <%struct.INT2**> [#uses=2]
+ at blkshifts = external global ptr ; <ptr> [#uses=2]
define i32 @xcompact() {
entry:
- store %struct.INT2* null, %struct.INT2** @blkshifts, align 4
+ store ptr null, ptr @blkshifts, align 4
br label %bb
bb: ; preds = %bb, %entry
- %tmp10 = load %struct.INT2*, %struct.INT2** @blkshifts, align 4 ; <%struct.INT2*> [#uses=0]
+ %tmp10 = load ptr, ptr @blkshifts, align 4 ; <ptr> [#uses=0]
; CHECK-NOT: %tmp10
br label %bb
}
diff --git a/llvm/test/Transforms/NewGVN/2007-07-25-Loop.ll b/llvm/test/Transforms/NewGVN/2007-07-25-Loop.ll
index e28753891918..336f390459b9 100644
--- a/llvm/test/Transforms/NewGVN/2007-07-25-Loop.ll
+++ b/llvm/test/Transforms/NewGVN/2007-07-25-Loop.ll
@@ -2,7 +2,7 @@
%struct.s_segment_inf = type { float, i32, i16, i16, float, float, i32, float, float }
-define void @print_arch(i8* %arch_file, i32 %route_type, i64 %det_routing_arch.0.0, i64 %det_routing_arch.0.1, i64 %det_routing_arch.0.2, i64 %det_routing_arch.0.3, i64 %det_routing_arch.0.4, %struct.s_segment_inf* %segment_inf, i64 %timing_inf.0.0, i64 %timing_inf.0.1, i64 %timing_inf.0.2, i64 %timing_inf.0.3, i64 %timing_inf.0.4, i32 %timing_inf.1) {
+define void @print_arch(ptr %arch_file, i32 %route_type, i64 %det_routing_arch.0.0, i64 %det_routing_arch.0.1, i64 %det_routing_arch.0.2, i64 %det_routing_arch.0.3, i64 %det_routing_arch.0.4, ptr %segment_inf, i64 %timing_inf.0.0, i64 %timing_inf.0.1, i64 %timing_inf.0.2, i64 %timing_inf.0.3, i64 %timing_inf.0.4, i32 %timing_inf.1) {
entry:
br i1 false, label %bb278, label %bb344
@@ -10,6 +10,6 @@ bb278: ; preds = %bb278, %entry
br i1 false, label %bb278, label %bb344
bb344: ; preds = %bb278, %entry
- %tmp38758 = load i16, i16* null, align 2 ; <i16> [#uses=0]
+ %tmp38758 = load i16, ptr null, align 2 ; <i16> [#uses=0]
ret void
}
diff --git a/llvm/test/Transforms/NewGVN/2007-07-25-NestedLoop.ll b/llvm/test/Transforms/NewGVN/2007-07-25-NestedLoop.ll
index 312cb22ac311..c46f2b7630ac 100644
--- a/llvm/test/Transforms/NewGVN/2007-07-25-NestedLoop.ll
+++ b/llvm/test/Transforms/NewGVN/2007-07-25-NestedLoop.ll
@@ -1,38 +1,38 @@
; RUN: opt < %s -passes=newgvn | llvm-dis
- %struct.TypHeader = type { i32, %struct.TypHeader**, [3 x i8], i8 }
+ %struct.TypHeader = type { i32, ptr, [3 x i8], i8 }
-define %struct.TypHeader* @LtRec(%struct.TypHeader* %hdL, %struct.TypHeader* %hdR) {
+define ptr @LtRec(ptr %hdL, ptr %hdR) {
entry:
br i1 false, label %bb556.preheader, label %bb534.preheader
bb534.preheader: ; preds = %entry
- ret %struct.TypHeader* null
+ ret ptr null
bb556.preheader: ; preds = %entry
- %tmp56119 = getelementptr %struct.TypHeader, %struct.TypHeader* %hdR, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp56220 = load i32, i32* %tmp56119 ; <i32> [#uses=0]
+ %tmp56119 = getelementptr %struct.TypHeader, ptr %hdR, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp56220 = load i32, ptr %tmp56119 ; <i32> [#uses=0]
br i1 false, label %bb.nph23, label %bb675.preheader
bb.nph23: ; preds = %bb556.preheader
- ret %struct.TypHeader* null
+ ret ptr null
bb656: ; preds = %bb675.outer, %bb656
- %tmp678 = load i32, i32* %tmp677 ; <i32> [#uses=0]
+ %tmp678 = load i32, ptr %tmp677 ; <i32> [#uses=0]
br i1 false, label %bb684, label %bb656
bb684: ; preds = %bb675.outer, %bb656
br i1 false, label %bb924.preheader, label %bb675.outer
bb675.outer: ; preds = %bb675.preheader, %bb684
- %tmp67812 = load i32, i32* %tmp67711 ; <i32> [#uses=0]
+ %tmp67812 = load i32, ptr %tmp67711 ; <i32> [#uses=0]
br i1 false, label %bb684, label %bb656
bb675.preheader: ; preds = %bb556.preheader
- %tmp67711 = getelementptr %struct.TypHeader, %struct.TypHeader* %hdR, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp677 = getelementptr %struct.TypHeader, %struct.TypHeader* %hdR, i32 0, i32 0 ; <i32*> [#uses=1]
+ %tmp67711 = getelementptr %struct.TypHeader, ptr %hdR, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp677 = getelementptr %struct.TypHeader, ptr %hdR, i32 0, i32 0 ; <ptr> [#uses=1]
br label %bb675.outer
bb924.preheader: ; preds = %bb684
- ret %struct.TypHeader* null
+ ret ptr null
}
diff --git a/llvm/test/Transforms/NewGVN/2007-07-25-SinglePredecessor.ll b/llvm/test/Transforms/NewGVN/2007-07-25-SinglePredecessor.ll
index b1c476bd7646..0b0597f44ee7 100644
--- a/llvm/test/Transforms/NewGVN/2007-07-25-SinglePredecessor.ll
+++ b/llvm/test/Transforms/NewGVN/2007-07-25-SinglePredecessor.ll
@@ -1,8 +1,8 @@
; RUN: opt < %s -passes=newgvn | llvm-dis
- %struct.ggBRDF = type { i32 (...)** }
+ %struct.ggBRDF = type { ptr }
%struct.ggBox3 = type { %struct.ggPoint3, %struct.ggPoint3 }
- %struct.ggMaterialRecord = type { %struct.ggPoint2, %struct.ggBox3, %struct.ggBox3, %struct.ggSpectrum, %struct.ggSpectrum, %struct.ggSpectrum, %struct.ggBRDF*, i32, i32, i32, i32 }
+ %struct.ggMaterialRecord = type { %struct.ggPoint2, %struct.ggBox3, %struct.ggBox3, %struct.ggSpectrum, %struct.ggSpectrum, %struct.ggSpectrum, ptr, i32, i32, i32, i32 }
%struct.ggONB3 = type { %struct.ggPoint3, %struct.ggPoint3, %struct.ggPoint3 }
%struct.ggPoint2 = type { [2 x double] }
%struct.ggPoint3 = type { [3 x double] }
@@ -10,18 +10,18 @@
%struct.mrViewingHitRecord = type { double, %struct.ggPoint3, %struct.ggONB3, %struct.ggPoint2, double, %struct.ggSpectrum, %struct.ggSpectrum, i32, i32, i32, i32 }
%struct.mrXEllipticalCylinder = type { %struct.ggBRDF, float, float, float, float, float, float }
-define i32 @_ZNK21mrZEllipticalCylinder10viewingHitERK6ggRay3dddR18mrViewingHitRecordR16ggMaterialRecord(%struct.mrXEllipticalCylinder* %this, %struct.ggBox3* %ray, double %unnamed_arg, double %tmin, double %tmax, %struct.mrViewingHitRecord* %VHR, %struct.ggMaterialRecord* %unnamed_arg2) {
+define i32 @_ZNK21mrZEllipticalCylinder10viewingHitERK6ggRay3dddR18mrViewingHitRecordR16ggMaterialRecord(ptr %this, ptr %ray, double %unnamed_arg, double %tmin, double %tmax, ptr %VHR, ptr %unnamed_arg2) {
entry:
- %tmp80.i = getelementptr %struct.mrViewingHitRecord, %struct.mrViewingHitRecord* %VHR, i32 0, i32 1, i32 0, i32 0 ; <double*> [#uses=1]
- store double 0.000000e+00, double* %tmp80.i
+ %tmp80.i = getelementptr %struct.mrViewingHitRecord, ptr %VHR, i32 0, i32 1, i32 0, i32 0 ; <ptr> [#uses=1]
+ store double 0.000000e+00, ptr %tmp80.i
br i1 false, label %return, label %cond_next.i
cond_next.i: ; preds = %entry
br i1 false, label %return, label %cond_true
cond_true: ; preds = %cond_next.i
- %tmp3.i8 = getelementptr %struct.mrViewingHitRecord, %struct.mrViewingHitRecord* %VHR, i32 0, i32 1, i32 0, i32 0 ; <double*> [#uses=1]
- %tmp46 = load double, double* %tmp3.i8 ; <double> [#uses=0]
+ %tmp3.i8 = getelementptr %struct.mrViewingHitRecord, ptr %VHR, i32 0, i32 1, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp46 = load double, ptr %tmp3.i8 ; <double> [#uses=0]
ret i32 1
return: ; preds = %cond_next.i, %entry
diff --git a/llvm/test/Transforms/NewGVN/2007-07-26-NonRedundant.ll b/llvm/test/Transforms/NewGVN/2007-07-26-NonRedundant.ll
index 5a4ae79733f2..8d3bfcd1367b 100644
--- a/llvm/test/Transforms/NewGVN/2007-07-26-NonRedundant.ll
+++ b/llvm/test/Transforms/NewGVN/2007-07-26-NonRedundant.ll
@@ -1,16 +1,16 @@
; RUN: opt < %s -passes=newgvn | llvm-dis
- at bsLive = external global i32 ; <i32*> [#uses=2]
+ at bsLive = external global i32 ; <ptr> [#uses=2]
define i32 @bsR(i32 %n) {
entry:
br i1 false, label %cond_next, label %bb19
cond_next: ; preds = %entry
- store i32 0, i32* @bsLive, align 4
+ store i32 0, ptr @bsLive, align 4
br label %bb19
bb19: ; preds = %cond_next, %entry
- %tmp29 = load i32, i32* @bsLive, align 4 ; <i32> [#uses=0]
+ %tmp29 = load i32, ptr @bsLive, align 4 ; <i32> [#uses=0]
ret i32 0
}
diff --git a/llvm/test/Transforms/NewGVN/2007-07-26-PhiErasure.ll b/llvm/test/Transforms/NewGVN/2007-07-26-PhiErasure.ll
index 532402ea57a2..22d64324c235 100644
--- a/llvm/test/Transforms/NewGVN/2007-07-26-PhiErasure.ll
+++ b/llvm/test/Transforms/NewGVN/2007-07-26-PhiErasure.ll
@@ -3,13 +3,13 @@
; RUN: opt < %s -passes=newgvn --enable-knowledge-retention -S | FileCheck %s
%struct..0anon = type { i32 }
-%struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
+%struct.FILE = type { ptr, i32, i32, i16, i16, %struct.__sbuf, i32, ptr, ptr, ptr, ptr, ptr, %struct.__sbuf, ptr, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
%struct.__sFILEX = type opaque
-%struct.__sbuf = type { i8*, i32 }
+%struct.__sbuf = type { ptr, i32 }
%struct.rtx_def = type { i16, i8, i8, [1 x %struct..0anon] }
- at n_spills = external global i32 ; <i32*> [#uses=2]
+ at n_spills = external global i32 ; <ptr> [#uses=2]
-define i32 @reload(%struct.rtx_def* %first, i32 %global, %struct.FILE* %dumpfile) {
+define i32 @reload(ptr %first, i32 %global, ptr %dumpfile) {
; CHECK-LABEL: @reload(
; CHECK-NEXT: cond_next2835.1:
; CHECK-NEXT: br label [[BB2928:%.*]]
@@ -20,11 +20,11 @@ define i32 @reload(%struct.rtx_def* %first, i32 %global, %struct.FILE* %dumpfile
; CHECK: cond_next2943:
; CHECK-NEXT: br i1 false, label [[BB2982_PREHEADER:%.*]], label [[BB2928]]
; CHECK: bb2982.preheader:
-; CHECK-NEXT: store i8 poison, i8* null
+; CHECK-NEXT: store i8 poison, ptr null
; CHECK-NEXT: ret i32 poison
;
cond_next2835.1: ; preds = %cond_next2861
- %tmp2922 = load i32, i32* @n_spills, align 4 ; <i32> [#uses=0]
+ %tmp2922 = load i32, ptr @n_spills, align 4 ; <i32> [#uses=0]
br label %bb2928
bb2928: ; preds = %cond_next2835.1, %cond_next2943
@@ -37,7 +37,7 @@ cond_next2943: ; preds = %cond_true2935, %bb2928
br i1 false, label %bb2982.preheader, label %bb2928
bb2982.preheader: ; preds = %cond_next2943
- %tmp298316 = load i32, i32* @n_spills, align 4 ; <i32> [#uses=0]
+ %tmp298316 = load i32, ptr @n_spills, align 4 ; <i32> [#uses=0]
ret i32 %tmp298316
}
diff --git a/llvm/test/Transforms/NewGVN/2007-07-30-PredIDom.ll b/llvm/test/Transforms/NewGVN/2007-07-30-PredIDom.ll
index 389ab5feb39c..59da31c5e33e 100644
--- a/llvm/test/Transforms/NewGVN/2007-07-30-PredIDom.ll
+++ b/llvm/test/Transforms/NewGVN/2007-07-30-PredIDom.ll
@@ -1,14 +1,14 @@
; RUN: opt < %s -passes=newgvn | llvm-dis
%"struct.Block::$_16" = type { i32 }
- %struct.Exp = type { %struct.Exp_*, i32, i32, i32, %struct.Exp*, %struct.Exp*, %"struct.Exp::$_10", %"struct.Block::$_16", %"struct.Exp::$_12" }
- %"struct.Exp::$_10" = type { %struct.Exp* }
- %"struct.Exp::$_12" = type { %struct.Exp** }
- %struct.Exp_ = type { i32, i32, i32, i32, %struct.Id* }
- %struct.Id = type { i8*, i32, i32, i32, %"struct.Id::$_13" }
+ %struct.Exp = type { ptr, i32, i32, i32, ptr, ptr, %"struct.Exp::$_10", %"struct.Block::$_16", %"struct.Exp::$_12" }
+ %"struct.Exp::$_10" = type { ptr }
+ %"struct.Exp::$_12" = type { ptr }
+ %struct.Exp_ = type { i32, i32, i32, i32, ptr }
+ %struct.Id = type { ptr, i32, i32, i32, %"struct.Id::$_13" }
%"struct.Id::$_13" = type { double }
-define i8* @_ZN3Exp8toStringEj(%struct.Exp* %this, i32 %nextpc) {
+define ptr @_ZN3Exp8toStringEj(ptr %this, i32 %nextpc) {
entry:
switch i32 0, label %bb970 [
i32 1, label %bb
@@ -23,7 +23,7 @@ entry:
]
bb: ; preds = %entry
- store i8* null, i8** null
+ store ptr null, ptr null
br label %return
bb39: ; preds = %entry
@@ -66,7 +66,7 @@ cond_true189: ; preds = %cond_next181
br label %cond_next191
cond_next191: ; preds = %cond_true189, %cond_next181
- store i8* null, i8** null
+ store ptr null, ptr null
br label %return
bb195: ; preds = %entry
@@ -85,7 +85,7 @@ cond_true265: ; preds = %cond_next252
br label %cond_next267
cond_next267: ; preds = %cond_true265, %cond_next252
- store i8* null, i8** null
+ store ptr null, ptr null
br label %return
bb270: ; preds = %entry
@@ -125,7 +125,7 @@ cond_true413: ; preds = %cond_next408
br label %cond_next415
cond_next415: ; preds = %cond_true413, %cond_next408
- store i8* null, i8** null
+ store ptr null, ptr null
br label %return
bb418: ; preds = %entry
@@ -180,7 +180,7 @@ cond_true628: ; preds = %cond_next623
br label %cond_next630
cond_next630: ; preds = %cond_true628, %cond_next623
- store i8* null, i8** null
+ store ptr null, ptr null
br label %return
bb633: ; preds = %entry
@@ -223,7 +223,7 @@ cond_true805: ; preds = %cond_next791
br label %cond_next807
cond_next807: ; preds = %cond_true805, %cond_next791
- store i8* null, i8** null
+ store ptr null, ptr null
br label %return
bb810: ; preds = %entry
@@ -239,7 +239,7 @@ cond_true877: ; preds = %cond_next872
br label %cond_next879
cond_next879: ; preds = %cond_true877, %cond_next872
- store i8* null, i8** null
+ store ptr null, ptr null
br label %return
bb882: ; preds = %entry
@@ -249,7 +249,7 @@ cond_true920: ; preds = %bb882
br label %cond_next922
cond_next922: ; preds = %cond_true920, %bb882
- store i8* null, i8** null
+ store ptr null, ptr null
br label %return
bb925: ; preds = %entry
@@ -259,16 +259,16 @@ cond_true965: ; preds = %bb925
br label %cond_next967
cond_next967: ; preds = %cond_true965, %bb925
- store i8* null, i8** null
+ store ptr null, ptr null
br label %return
bb970: ; preds = %entry
unreachable
; No predecessors!
- store i8* null, i8** null
+ store ptr null, ptr null
br label %return
return: ; preds = %0, %cond_next967, %cond_next922, %cond_next879, %cond_next807, %cond_next630, %cond_next415, %cond_next267, %cond_next191, %bb
- %retval980 = load i8*, i8** null ; <i8*> [#uses=1]
- ret i8* %retval980
+ %retval980 = load ptr, ptr null ; <ptr> [#uses=1]
+ ret ptr %retval980
}
diff --git a/llvm/test/Transforms/NewGVN/2007-07-31-NoDomInherit-xfail.ll b/llvm/test/Transforms/NewGVN/2007-07-31-NoDomInherit-xfail.ll
index d4d65b047b59..f72fcbc7bd68 100644
--- a/llvm/test/Transforms/NewGVN/2007-07-31-NoDomInherit-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/2007-07-31-NoDomInherit-xfail.ll
@@ -1,69 +1,69 @@
; XFAIL: *
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
- %struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* }
- at debug = external constant i32 ; <i32*> [#uses=0]
- at counters = external constant i32 ; <i32*> [#uses=1]
- at trialx = external global [17 x i32] ; <[17 x i32]*> [#uses=1]
- at dummy1 = external global [7 x i32] ; <[7 x i32]*> [#uses=0]
- at dummy2 = external global [4 x i32] ; <[4 x i32]*> [#uses=0]
- at unacceptable = external global i32 ; <i32*> [#uses=0]
- at isa = external global [13 x %struct.anon] ; <[13 x %struct.anon]*> [#uses=3]
- at .str = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str1 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
- at .str2 = external constant [1 x i8] ; <[1 x i8]*> [#uses=0]
- at .str3 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str4 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
- at .str5 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str6 = external constant [2 x i8] ; <[2 x i8]*> [#uses=0]
- at .str7 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str8 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str9 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str10 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str11 = external constant [2 x i8] ; <[2 x i8]*> [#uses=0]
- at .str12 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str13 = external constant [2 x i8] ; <[2 x i8]*> [#uses=0]
- at .str14 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
- at .str15 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
- at .str16 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str17 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str18 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
- at .str19 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str20 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str21 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str22 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str23 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
- at .str24 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str25 = external constant [6 x i8] ; <[6 x i8]*> [#uses=0]
- at .str26 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
- at .str27 = external constant [6 x i8] ; <[6 x i8]*> [#uses=0]
- at r = external global [17 x i32] ; <[17 x i32]*> [#uses=0]
- at .str28 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
- at .str29 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
- at pgm = external global [5 x { i32, [3 x i32] }] ; <[5 x { i32, [3 x i32] }]*> [#uses=4]
- at .str30 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
- at .str31 = external constant [13 x i8] ; <[13 x i8]*> [#uses=0]
- at .str32 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
- at .str33 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
- at .str34 = external constant [20 x i8] ; <[20 x i8]*> [#uses=0]
- at numi = external global i32 ; <i32*> [#uses=7]
- at .str35 = external constant [10 x i8] ; <[10 x i8]*> [#uses=0]
- at counter = external global [5 x i32] ; <[5 x i32]*> [#uses=2]
- at itrialx.2510 = external global i32 ; <i32*> [#uses=0]
- at .str36 = external constant [43 x i8] ; <[43 x i8]*> [#uses=0]
- at .str37 = external constant [42 x i8] ; <[42 x i8]*> [#uses=0]
- at corr_result = external global i32 ; <i32*> [#uses=0]
- at .str38 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0]
- at .str39 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0]
- at .str40 = external constant [47 x i8] ; <[47 x i8]*> [#uses=0]
- at correct_result = external global [17 x i32] ; <[17 x i32]*> [#uses=1]
- at .str41 = external constant [46 x i8] ; <[46 x i8]*> [#uses=0]
- at .str42 = external constant [32 x i8] ; <[32 x i8]*> [#uses=0]
- at .str43 = external constant [44 x i8] ; <[44 x i8]*> [#uses=1]
- at .str44 = external constant [21 x i8] ; <[21 x i8]*> [#uses=1]
- at .str45 = external constant [12 x i8] ; <[12 x i8]*> [#uses=1]
- at .str46 = external constant [5 x i8] ; <[5 x i8]*> [#uses=1]
- at .str47 = external constant [12 x i8] ; <[12 x i8]*> [#uses=1]
+ %struct.anon = type { ptr, i32, i32, [3 x i32], ptr, ptr, ptr }
+ at debug = external constant i32 ; <ptr> [#uses=0]
+ at counters = external constant i32 ; <ptr> [#uses=1]
+ at trialx = external global [17 x i32] ; <ptr> [#uses=1]
+ at dummy1 = external global [7 x i32] ; <ptr> [#uses=0]
+ at dummy2 = external global [4 x i32] ; <ptr> [#uses=0]
+ at unacceptable = external global i32 ; <ptr> [#uses=0]
+ at isa = external global [13 x %struct.anon] ; <ptr> [#uses=3]
+ at .str = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str1 = external constant [3 x i8] ; <ptr> [#uses=0]
+ at .str2 = external constant [1 x i8] ; <ptr> [#uses=0]
+ at .str3 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str4 = external constant [3 x i8] ; <ptr> [#uses=0]
+ at .str5 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str6 = external constant [2 x i8] ; <ptr> [#uses=0]
+ at .str7 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str8 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str9 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str10 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str11 = external constant [2 x i8] ; <ptr> [#uses=0]
+ at .str12 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str13 = external constant [2 x i8] ; <ptr> [#uses=0]
+ at .str14 = external constant [5 x i8] ; <ptr> [#uses=0]
+ at .str15 = external constant [5 x i8] ; <ptr> [#uses=0]
+ at .str16 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str17 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str18 = external constant [3 x i8] ; <ptr> [#uses=0]
+ at .str19 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str20 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str21 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str22 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str23 = external constant [5 x i8] ; <ptr> [#uses=0]
+ at .str24 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str25 = external constant [6 x i8] ; <ptr> [#uses=0]
+ at .str26 = external constant [5 x i8] ; <ptr> [#uses=0]
+ at .str27 = external constant [6 x i8] ; <ptr> [#uses=0]
+ at r = external global [17 x i32] ; <ptr> [#uses=0]
+ at .str28 = external constant [3 x i8] ; <ptr> [#uses=0]
+ at .str29 = external constant [5 x i8] ; <ptr> [#uses=0]
+ at pgm = external global [5 x { i32, [3 x i32] }] ; <ptr> [#uses=4]
+ at .str30 = external constant [3 x i8] ; <ptr> [#uses=0]
+ at .str31 = external constant [13 x i8] ; <ptr> [#uses=0]
+ at .str32 = external constant [3 x i8] ; <ptr> [#uses=0]
+ at .str33 = external constant [4 x i8] ; <ptr> [#uses=0]
+ at .str34 = external constant [20 x i8] ; <ptr> [#uses=0]
+ at numi = external global i32 ; <ptr> [#uses=7]
+ at .str35 = external constant [10 x i8] ; <ptr> [#uses=0]
+ at counter = external global [5 x i32] ; <ptr> [#uses=2]
+ at itrialx.2510 = external global i32 ; <ptr> [#uses=0]
+ at .str36 = external constant [43 x i8] ; <ptr> [#uses=0]
+ at .str37 = external constant [42 x i8] ; <ptr> [#uses=0]
+ at corr_result = external global i32 ; <ptr> [#uses=0]
+ at .str38 = external constant [3 x i8] ; <ptr> [#uses=0]
+ at .str39 = external constant [5 x i8] ; <ptr> [#uses=0]
+ at .str40 = external constant [47 x i8] ; <ptr> [#uses=0]
+ at correct_result = external global [17 x i32] ; <ptr> [#uses=1]
+ at .str41 = external constant [46 x i8] ; <ptr> [#uses=0]
+ at .str42 = external constant [32 x i8] ; <ptr> [#uses=0]
+ at .str43 = external constant [44 x i8] ; <ptr> [#uses=1]
+ at .str44 = external constant [21 x i8] ; <ptr> [#uses=1]
+ at .str45 = external constant [12 x i8] ; <ptr> [#uses=1]
+ at .str46 = external constant [5 x i8] ; <ptr> [#uses=1]
+ at .str47 = external constant [12 x i8] ; <ptr> [#uses=1]
declare i32 @neg(i32, i32, i32)
@@ -113,7 +113,7 @@ declare i32 @selle(i32, i32, i32)
declare void @print_expr(i32)
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
declare i32 @putchar(i32)
@@ -123,7 +123,7 @@ declare void @simulate_one_instruction(i32)
declare i32 @check(i32)
-declare i32 @puts(i8*)
+declare i32 @puts(ptr)
declare void @fix_operands(i32)
@@ -133,96 +133,96 @@ declare i32 @increment()
declare i32 @search()
-define i32 @main(i32 %argc, i8** %argv) {
+define i32 @main(i32 %argc, ptr %argv) {
entry:
- %argc_addr = alloca i32 ; <i32*> [#uses=1]
- %argv_addr = alloca i8** ; <i8***> [#uses=1]
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
- %i = alloca i32, align 4 ; <i32*> [#uses=21]
- %num_sol = alloca i32, align 4 ; <i32*> [#uses=4]
- %total = alloca i32, align 4 ; <i32*> [#uses=4]
+ %argc_addr = alloca i32 ; <ptr> [#uses=1]
+ %argv_addr = alloca ptr ; <ptr> [#uses=1]
+ %retval = alloca i32, align 4 ; <ptr> [#uses=2]
+ %tmp = alloca i32, align 4 ; <ptr> [#uses=2]
+ %i = alloca i32, align 4 ; <ptr> [#uses=21]
+ %num_sol = alloca i32, align 4 ; <ptr> [#uses=4]
+ %total = alloca i32, align 4 ; <ptr> [#uses=4]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 %argc, i32* %argc_addr
- store i8** %argv, i8*** %argv_addr
- store i32 0, i32* %num_sol
- store i32 1, i32* @numi
+ store i32 %argc, ptr %argc_addr
+ store ptr %argv, ptr %argv_addr
+ store i32 0, ptr %num_sol
+ store i32 1, ptr @numi
br label %bb91
bb: ; preds = %cond_next97
- %tmp1 = load i32, i32* @numi ; <i32> [#uses=1]
- %tmp2 = getelementptr [44 x i8], [44 x i8]* @.str43, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp3 = call i32 (i8*, ...) @printf( i8* %tmp2, i32 %tmp1 ) ; <i32> [#uses=0]
- store i32 0, i32* %i
+ %tmp1 = load i32, ptr @numi ; <i32> [#uses=1]
+ %tmp2 = getelementptr [44 x i8], ptr @.str43, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp3 = call i32 (ptr, ...) @printf( ptr %tmp2, i32 %tmp1 ) ; <i32> [#uses=0]
+ store i32 0, ptr %i
br label %bb13
bb4: ; preds = %bb13
- %tmp5 = load i32, i32* %i ; <i32> [#uses=1]
- %tmp6 = load i32, i32* %i ; <i32> [#uses=1]
- %tmp7 = getelementptr [17 x i32], [17 x i32]* @trialx, i32 0, i32 %tmp6 ; <i32*> [#uses=1]
- %tmp8 = load i32, i32* %tmp7 ; <i32> [#uses=1]
+ %tmp5 = load i32, ptr %i ; <i32> [#uses=1]
+ %tmp6 = load i32, ptr %i ; <i32> [#uses=1]
+ %tmp7 = getelementptr [17 x i32], ptr @trialx, i32 0, i32 %tmp6 ; <ptr> [#uses=1]
+ %tmp8 = load i32, ptr %tmp7 ; <i32> [#uses=1]
%tmp9 = call i32 @userfun( i32 %tmp8 ) ; <i32> [#uses=1]
- %tmp10 = getelementptr [17 x i32], [17 x i32]* @correct_result, i32 0, i32 %tmp5 ; <i32*> [#uses=1]
- store i32 %tmp9, i32* %tmp10
- %tmp11 = load i32, i32* %i ; <i32> [#uses=1]
+ %tmp10 = getelementptr [17 x i32], ptr @correct_result, i32 0, i32 %tmp5 ; <ptr> [#uses=1]
+ store i32 %tmp9, ptr %tmp10
+ %tmp11 = load i32, ptr %i ; <i32> [#uses=1]
%tmp12 = add i32 %tmp11, 1 ; <i32> [#uses=1]
- store i32 %tmp12, i32* %i
+ store i32 %tmp12, ptr %i
br label %bb13
bb13: ; preds = %bb4, %bb
- %tmp14 = load i32, i32* %i ; <i32> [#uses=1]
+ %tmp14 = load i32, ptr %i ; <i32> [#uses=1]
%tmp15 = icmp sle i32 %tmp14, 16 ; <i1> [#uses=1]
%tmp1516 = zext i1 %tmp15 to i32 ; <i32> [#uses=1]
%toBool = icmp ne i32 %tmp1516, 0 ; <i1> [#uses=1]
br i1 %toBool, label %bb4, label %bb17
bb17: ; preds = %bb13
- store i32 0, i32* %i
+ store i32 0, ptr %i
br label %bb49
bb18: ; preds = %bb49
- %tmp19 = load i32, i32* %i ; <i32> [#uses=1]
- %tmp20 = getelementptr [5 x { i32, [3 x i32] }], [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp19 ; <{ i32, [3 x i32] }*> [#uses=1]
- %tmp21 = getelementptr { i32, [3 x i32] }, { i32, [3 x i32] }* %tmp20, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 0, i32* %tmp21
- %tmp22 = load i32, i32* %i ; <i32> [#uses=1]
- %tmp23 = getelementptr [13 x %struct.anon], [13 x %struct.anon]* @isa, i32 0, i32 0 ; <%struct.anon*> [#uses=1]
- %tmp24 = getelementptr %struct.anon, %struct.anon* %tmp23, i32 0, i32 3 ; <[3 x i32]*> [#uses=1]
- %tmp25 = getelementptr [3 x i32], [3 x i32]* %tmp24, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp26 = load i32, i32* %tmp25 ; <i32> [#uses=1]
- %tmp27 = getelementptr [5 x { i32, [3 x i32] }], [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp22 ; <{ i32, [3 x i32] }*> [#uses=1]
- %tmp28 = getelementptr { i32, [3 x i32] }, { i32, [3 x i32] }* %tmp27, i32 0, i32 1 ; <[3 x i32]*> [#uses=1]
- %tmp29 = getelementptr [3 x i32], [3 x i32]* %tmp28, i32 0, i32 0 ; <i32*> [#uses=1]
- store i32 %tmp26, i32* %tmp29
- %tmp30 = load i32, i32* %i ; <i32> [#uses=1]
- %tmp31 = getelementptr [13 x %struct.anon], [13 x %struct.anon]* @isa, i32 0, i32 0 ; <%struct.anon*> [#uses=1]
- %tmp32 = getelementptr %struct.anon, %struct.anon* %tmp31, i32 0, i32 3 ; <[3 x i32]*> [#uses=1]
- %tmp33 = getelementptr [3 x i32], [3 x i32]* %tmp32, i32 0, i32 1 ; <i32*> [#uses=1]
- %tmp34 = load i32, i32* %tmp33 ; <i32> [#uses=1]
- %tmp35 = getelementptr [5 x { i32, [3 x i32] }], [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp30 ; <{ i32, [3 x i32] }*> [#uses=1]
- %tmp36 = getelementptr { i32, [3 x i32] }, { i32, [3 x i32] }* %tmp35, i32 0, i32 1 ; <[3 x i32]*> [#uses=1]
- %tmp37 = getelementptr [3 x i32], [3 x i32]* %tmp36, i32 0, i32 1 ; <i32*> [#uses=1]
- store i32 %tmp34, i32* %tmp37
- %tmp38 = load i32, i32* %i ; <i32> [#uses=1]
- %tmp39 = getelementptr [13 x %struct.anon], [13 x %struct.anon]* @isa, i32 0, i32 0 ; <%struct.anon*> [#uses=1]
- %tmp40 = getelementptr %struct.anon, %struct.anon* %tmp39, i32 0, i32 3 ; <[3 x i32]*> [#uses=1]
- %tmp41 = getelementptr [3 x i32], [3 x i32]* %tmp40, i32 0, i32 2 ; <i32*> [#uses=1]
- %tmp42 = load i32, i32* %tmp41 ; <i32> [#uses=1]
- %tmp43 = getelementptr [5 x { i32, [3 x i32] }], [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp38 ; <{ i32, [3 x i32] }*> [#uses=1]
- %tmp44 = getelementptr { i32, [3 x i32] }, { i32, [3 x i32] }* %tmp43, i32 0, i32 1 ; <[3 x i32]*> [#uses=1]
- %tmp45 = getelementptr [3 x i32], [3 x i32]* %tmp44, i32 0, i32 2 ; <i32*> [#uses=1]
- store i32 %tmp42, i32* %tmp45
- %tmp46 = load i32, i32* %i ; <i32> [#uses=1]
+ %tmp19 = load i32, ptr %i ; <i32> [#uses=1]
+ %tmp20 = getelementptr [5 x { i32, [3 x i32] }], ptr @pgm, i32 0, i32 %tmp19 ; <ptr> [#uses=1]
+ %tmp21 = getelementptr { i32, [3 x i32] }, ptr %tmp20, i32 0, i32 0 ; <ptr> [#uses=1]
+ store i32 0, ptr %tmp21
+ %tmp22 = load i32, ptr %i ; <i32> [#uses=1]
+ %tmp23 = getelementptr [13 x %struct.anon], ptr @isa, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp24 = getelementptr %struct.anon, ptr %tmp23, i32 0, i32 3 ; <ptr> [#uses=1]
+ %tmp25 = getelementptr [3 x i32], ptr %tmp24, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp26 = load i32, ptr %tmp25 ; <i32> [#uses=1]
+ %tmp27 = getelementptr [5 x { i32, [3 x i32] }], ptr @pgm, i32 0, i32 %tmp22 ; <ptr> [#uses=1]
+ %tmp28 = getelementptr { i32, [3 x i32] }, ptr %tmp27, i32 0, i32 1 ; <ptr> [#uses=1]
+ %tmp29 = getelementptr [3 x i32], ptr %tmp28, i32 0, i32 0 ; <ptr> [#uses=1]
+ store i32 %tmp26, ptr %tmp29
+ %tmp30 = load i32, ptr %i ; <i32> [#uses=1]
+ %tmp31 = getelementptr [13 x %struct.anon], ptr @isa, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp32 = getelementptr %struct.anon, ptr %tmp31, i32 0, i32 3 ; <ptr> [#uses=1]
+ %tmp33 = getelementptr [3 x i32], ptr %tmp32, i32 0, i32 1 ; <ptr> [#uses=1]
+ %tmp34 = load i32, ptr %tmp33 ; <i32> [#uses=1]
+ %tmp35 = getelementptr [5 x { i32, [3 x i32] }], ptr @pgm, i32 0, i32 %tmp30 ; <ptr> [#uses=1]
+ %tmp36 = getelementptr { i32, [3 x i32] }, ptr %tmp35, i32 0, i32 1 ; <ptr> [#uses=1]
+ %tmp37 = getelementptr [3 x i32], ptr %tmp36, i32 0, i32 1 ; <ptr> [#uses=1]
+ store i32 %tmp34, ptr %tmp37
+ %tmp38 = load i32, ptr %i ; <i32> [#uses=1]
+ %tmp39 = getelementptr [13 x %struct.anon], ptr @isa, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp40 = getelementptr %struct.anon, ptr %tmp39, i32 0, i32 3 ; <ptr> [#uses=1]
+ %tmp41 = getelementptr [3 x i32], ptr %tmp40, i32 0, i32 2 ; <ptr> [#uses=1]
+ %tmp42 = load i32, ptr %tmp41 ; <i32> [#uses=1]
+ %tmp43 = getelementptr [5 x { i32, [3 x i32] }], ptr @pgm, i32 0, i32 %tmp38 ; <ptr> [#uses=1]
+ %tmp44 = getelementptr { i32, [3 x i32] }, ptr %tmp43, i32 0, i32 1 ; <ptr> [#uses=1]
+ %tmp45 = getelementptr [3 x i32], ptr %tmp44, i32 0, i32 2 ; <ptr> [#uses=1]
+ store i32 %tmp42, ptr %tmp45
+ %tmp46 = load i32, ptr %i ; <i32> [#uses=1]
call void @fix_operands( i32 %tmp46 )
- %tmp47 = load i32, i32* %i ; <i32> [#uses=1]
+ %tmp47 = load i32, ptr %i ; <i32> [#uses=1]
; CHECK: %tmp47 = phi i32 [ %tmp48, %bb18 ], [ 0, %bb17 ]
%tmp48 = add i32 %tmp47, 1 ; <i32> [#uses=1]
- store i32 %tmp48, i32* %i
+ store i32 %tmp48, ptr %i
br label %bb49
bb49: ; preds = %bb18, %bb17
- %tmp50 = load i32, i32* @numi ; <i32> [#uses=1]
- %tmp51 = load i32, i32* %i ; <i32> [#uses=1]
+ %tmp50 = load i32, ptr @numi ; <i32> [#uses=1]
+ %tmp51 = load i32, ptr %i ; <i32> [#uses=1]
%tmp52 = icmp slt i32 %tmp51, %tmp50 ; <i1> [#uses=1]
%tmp5253 = zext i1 %tmp52 to i32 ; <i32> [#uses=1]
%toBool54 = icmp ne i32 %tmp5253, 0 ; <i1> [#uses=1]
@@ -230,62 +230,62 @@ bb49: ; preds = %bb18, %bb17
bb55: ; preds = %bb49
%tmp56 = call i32 @search( ) ; <i32> [#uses=1]
- store i32 %tmp56, i32* %num_sol
- %tmp57 = getelementptr [21 x i8], [21 x i8]* @.str44, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp58 = load i32, i32* %num_sol ; <i32> [#uses=1]
- %tmp59 = call i32 (i8*, ...) @printf( i8* %tmp57, i32 %tmp58 ) ; <i32> [#uses=0]
- %tmp60 = load i32, i32* @counters ; <i32> [#uses=1]
+ store i32 %tmp56, ptr %num_sol
+ %tmp57 = getelementptr [21 x i8], ptr @.str44, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp58 = load i32, ptr %num_sol ; <i32> [#uses=1]
+ %tmp59 = call i32 (ptr, ...) @printf( ptr %tmp57, i32 %tmp58 ) ; <i32> [#uses=0]
+ %tmp60 = load i32, ptr @counters ; <i32> [#uses=1]
%tmp61 = icmp ne i32 %tmp60, 0 ; <i1> [#uses=1]
%tmp6162 = zext i1 %tmp61 to i32 ; <i32> [#uses=1]
%toBool63 = icmp ne i32 %tmp6162, 0 ; <i1> [#uses=1]
br i1 %toBool63, label %cond_true, label %cond_next
cond_true: ; preds = %bb55
- store i32 0, i32* %total
- %tmp64 = getelementptr [12 x i8], [12 x i8]* @.str45, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp65 = call i32 (i8*, ...) @printf( i8* %tmp64 ) ; <i32> [#uses=0]
- store i32 0, i32* %i
+ store i32 0, ptr %total
+ %tmp64 = getelementptr [12 x i8], ptr @.str45, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp65 = call i32 (ptr, ...) @printf( ptr %tmp64 ) ; <i32> [#uses=0]
+ store i32 0, ptr %i
br label %bb79
bb66: ; preds = %bb79
- %tmp67 = load i32, i32* %i ; <i32> [#uses=1]
- %tmp68 = getelementptr [5 x i32], [5 x i32]* @counter, i32 0, i32 %tmp67 ; <i32*> [#uses=1]
- %tmp69 = load i32, i32* %tmp68 ; <i32> [#uses=1]
- %tmp70 = getelementptr [5 x i8], [5 x i8]* @.str46, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp71 = call i32 (i8*, ...) @printf( i8* %tmp70, i32 %tmp69 ) ; <i32> [#uses=0]
- %tmp72 = load i32, i32* %i ; <i32> [#uses=1]
- %tmp73 = getelementptr [5 x i32], [5 x i32]* @counter, i32 0, i32 %tmp72 ; <i32*> [#uses=1]
- %tmp74 = load i32, i32* %tmp73 ; <i32> [#uses=1]
- %tmp75 = load i32, i32* %total ; <i32> [#uses=1]
+ %tmp67 = load i32, ptr %i ; <i32> [#uses=1]
+ %tmp68 = getelementptr [5 x i32], ptr @counter, i32 0, i32 %tmp67 ; <ptr> [#uses=1]
+ %tmp69 = load i32, ptr %tmp68 ; <i32> [#uses=1]
+ %tmp70 = getelementptr [5 x i8], ptr @.str46, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp71 = call i32 (ptr, ...) @printf( ptr %tmp70, i32 %tmp69 ) ; <i32> [#uses=0]
+ %tmp72 = load i32, ptr %i ; <i32> [#uses=1]
+ %tmp73 = getelementptr [5 x i32], ptr @counter, i32 0, i32 %tmp72 ; <ptr> [#uses=1]
+ %tmp74 = load i32, ptr %tmp73 ; <i32> [#uses=1]
+ %tmp75 = load i32, ptr %total ; <i32> [#uses=1]
%tmp76 = add i32 %tmp74, %tmp75 ; <i32> [#uses=1]
- store i32 %tmp76, i32* %total
- %tmp77 = load i32, i32* %i ; <i32> [#uses=1]
+ store i32 %tmp76, ptr %total
+ %tmp77 = load i32, ptr %i ; <i32> [#uses=1]
%tmp78 = add i32 %tmp77, 1 ; <i32> [#uses=1]
- store i32 %tmp78, i32* %i
+ store i32 %tmp78, ptr %i
br label %bb79
bb79: ; preds = %bb66, %cond_true
- %tmp80 = load i32, i32* @numi ; <i32> [#uses=1]
- %tmp81 = load i32, i32* %i ; <i32> [#uses=1]
+ %tmp80 = load i32, ptr @numi ; <i32> [#uses=1]
+ %tmp81 = load i32, ptr %i ; <i32> [#uses=1]
%tmp82 = icmp slt i32 %tmp81, %tmp80 ; <i1> [#uses=1]
%tmp8283 = zext i1 %tmp82 to i32 ; <i32> [#uses=1]
%toBool84 = icmp ne i32 %tmp8283, 0 ; <i1> [#uses=1]
br i1 %toBool84, label %bb66, label %bb85
bb85: ; preds = %bb79
- %tmp86 = getelementptr [12 x i8], [12 x i8]* @.str47, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp87 = load i32, i32* %total ; <i32> [#uses=1]
- %tmp88 = call i32 (i8*, ...) @printf( i8* %tmp86, i32 %tmp87 ) ; <i32> [#uses=0]
+ %tmp86 = getelementptr [12 x i8], ptr @.str47, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp87 = load i32, ptr %total ; <i32> [#uses=1]
+ %tmp88 = call i32 (ptr, ...) @printf( ptr %tmp86, i32 %tmp87 ) ; <i32> [#uses=0]
br label %cond_next
cond_next: ; preds = %bb85, %bb55
- %tmp89 = load i32, i32* @numi ; <i32> [#uses=1]
+ %tmp89 = load i32, ptr @numi ; <i32> [#uses=1]
%tmp90 = add i32 %tmp89, 1 ; <i32> [#uses=1]
- store i32 %tmp90, i32* @numi
+ store i32 %tmp90, ptr @numi
br label %bb91
bb91: ; preds = %cond_next, %entry
- %tmp92 = load i32, i32* @numi ; <i32> [#uses=1]
+ %tmp92 = load i32, ptr @numi ; <i32> [#uses=1]
%tmp93 = icmp sgt i32 %tmp92, 5 ; <i1> [#uses=1]
%tmp9394 = zext i1 %tmp93 to i32 ; <i32> [#uses=1]
%toBool95 = icmp ne i32 %tmp9394, 0 ; <i1> [#uses=1]
@@ -295,20 +295,20 @@ cond_true96: ; preds = %bb91
br label %bb102
cond_next97: ; preds = %bb91
- %tmp98 = load i32, i32* %num_sol ; <i32> [#uses=1]
+ %tmp98 = load i32, ptr %num_sol ; <i32> [#uses=1]
%tmp99 = icmp eq i32 %tmp98, 0 ; <i1> [#uses=1]
%tmp99100 = zext i1 %tmp99 to i32 ; <i32> [#uses=1]
%toBool101 = icmp ne i32 %tmp99100, 0 ; <i1> [#uses=1]
br i1 %toBool101, label %bb, label %bb102
bb102: ; preds = %cond_next97, %cond_true96
- store i32 0, i32* %tmp
- %tmp103 = load i32, i32* %tmp ; <i32> [#uses=1]
- store i32 %tmp103, i32* %retval
+ store i32 0, ptr %tmp
+ %tmp103 = load i32, ptr %tmp ; <i32> [#uses=1]
+ store i32 %tmp103, ptr %retval
br label %return
return: ; preds = %bb102
- %retval104 = load i32, i32* %retval ; <i32> [#uses=1]
+ %retval104 = load i32, ptr %retval ; <i32> [#uses=1]
ret i32 %retval104
}
diff --git a/llvm/test/Transforms/NewGVN/2007-07-31-RedundantPhi.ll b/llvm/test/Transforms/NewGVN/2007-07-31-RedundantPhi.ll
index a7d807f80736..934fffc986f8 100644
--- a/llvm/test/Transforms/NewGVN/2007-07-31-RedundantPhi.ll
+++ b/llvm/test/Transforms/NewGVN/2007-07-31-RedundantPhi.ll
@@ -1,10 +1,10 @@
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
- at img_width = external global i16 ; <i16*> [#uses=2]
+ at img_width = external global i16 ; <ptr> [#uses=2]
-define i32 @smpUMHEXBipredIntegerPelBlockMotionSearch(i16* %cur_pic, i16 signext %ref, i32 %list, i32 %pic_pix_x, i32 %pic_pix_y, i32 %blocktype, i16 signext %pred_mv_x1, i16 signext %pred_mv_y1, i16 signext %pred_mv_x2, i16 signext %pred_mv_y2, i16* %mv_x, i16* %mv_y, i16* %s_mv_x, i16* %s_mv_y, i32 %search_range, i32 %min_mcost, i32 %lambda_factor) {
+define i32 @smpUMHEXBipredIntegerPelBlockMotionSearch(ptr %cur_pic, i16 signext %ref, i32 %list, i32 %pic_pix_x, i32 %pic_pix_y, i32 %blocktype, i16 signext %pred_mv_x1, i16 signext %pred_mv_y1, i16 signext %pred_mv_x2, i16 signext %pred_mv_y2, ptr %mv_x, ptr %mv_y, ptr %s_mv_x, ptr %s_mv_y, i32 %search_range, i32 %min_mcost, i32 %lambda_factor) {
cond_next143: ; preds = %entry
- store i16 0, i16* @img_width, align 2
+ store i16 0, ptr @img_width, align 2
br i1 false, label %cond_next449, label %cond_false434
cond_false434: ; preds = %cond_true415
@@ -17,7 +17,7 @@ cond_false470: ; preds = %cond_next449
br label %cond_next698
cond_next698: ; preds = %cond_true492
- %tmp701 = load i16, i16* @img_width, align 2 ; <i16> [#uses=0]
+ %tmp701 = load i16, ptr @img_width, align 2 ; <i16> [#uses=0]
; CHECK-NOT: %tmp701 =
ret i32 0
}
diff --git a/llvm/test/Transforms/NewGVN/2008-02-12-UndefLoad-xfail.ll b/llvm/test/Transforms/NewGVN/2008-02-12-UndefLoad-xfail.ll
index e646c51e17c7..3b02b471ecc6 100644
--- a/llvm/test/Transforms/NewGVN/2008-02-12-UndefLoad-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/2008-02-12-UndefLoad-xfail.ll
@@ -6,15 +6,15 @@
define i32 @a() {
entry:
- %c = alloca %struct.anon ; <%struct.anon*> [#uses=2]
- %tmp = getelementptr %struct.anon, %struct.anon* %c, i32 0, i32 0 ; <i32*> [#uses=1]
- %tmp1 = getelementptr i32, i32* %tmp, i32 1 ; <i32*> [#uses=2]
- %tmp2 = load i32, i32* %tmp1, align 4 ; <i32> [#uses=1]
+ %c = alloca %struct.anon ; <ptr> [#uses=2]
+ %tmp = getelementptr %struct.anon, ptr %c, i32 0, i32 0 ; <ptr> [#uses=1]
+ %tmp1 = getelementptr i32, ptr %tmp, i32 1 ; <ptr> [#uses=2]
+ %tmp2 = load i32, ptr %tmp1, align 4 ; <i32> [#uses=1]
; CHECK-NOT: load
%tmp3 = or i32 %tmp2, 11 ; <i32> [#uses=1]
%tmp4 = and i32 %tmp3, -21 ; <i32> [#uses=1]
- store i32 %tmp4, i32* %tmp1, align 4
- %call = call i32 (...) @x( %struct.anon* %c ) ; <i32> [#uses=0]
+ store i32 %tmp4, ptr %tmp1, align 4
+ %call = call i32 (...) @x( ptr %c ) ; <i32> [#uses=0]
ret i32 undef
}
diff --git a/llvm/test/Transforms/NewGVN/2008-02-13-NewPHI.ll b/llvm/test/Transforms/NewGVN/2008-02-13-NewPHI.ll
index fc99f8fb35c2..b2440fbced41 100644
--- a/llvm/test/Transforms/NewGVN/2008-02-13-NewPHI.ll
+++ b/llvm/test/Transforms/NewGVN/2008-02-13-NewPHI.ll
@@ -1,22 +1,22 @@
; RUN: opt < %s -passes=newgvn
; PR2032
-define i32 @sscal(i32 %n, double %sa1, float* %sx, i32 %incx) {
+define i32 @sscal(i32 %n, double %sa1, ptr %sx, i32 %incx) {
entry:
- %sx_addr = alloca float* ; <float**> [#uses=3]
- store float* %sx, float** %sx_addr, align 4
+ %sx_addr = alloca ptr ; <ptr> [#uses=3]
+ store ptr %sx, ptr %sx_addr, align 4
br label %bb33
bb: ; preds = %bb33
- %tmp27 = load float*, float** %sx_addr, align 4 ; <float*> [#uses=1]
- store float 0.000000e+00, float* %tmp27, align 4
- store float* null, float** %sx_addr, align 4
+ %tmp27 = load ptr, ptr %sx_addr, align 4 ; <ptr> [#uses=1]
+ store float 0.000000e+00, ptr %tmp27, align 4
+ store ptr null, ptr %sx_addr, align 4
br label %bb33
bb33: ; preds = %bb, %entry
br i1 false, label %bb, label %return
return: ; preds = %bb33
- %retval59 = load i32, i32* null, align 4 ; <i32> [#uses=1]
+ %retval59 = load i32, ptr null, align 4 ; <i32> [#uses=1]
ret i32 %retval59
}
diff --git a/llvm/test/Transforms/NewGVN/2008-07-02-Unreachable.ll b/llvm/test/Transforms/NewGVN/2008-07-02-Unreachable.ll
index d7371624a5c9..0c1891e46d26 100644
--- a/llvm/test/Transforms/NewGVN/2008-07-02-Unreachable.ll
+++ b/llvm/test/Transforms/NewGVN/2008-07-02-Unreachable.ll
@@ -1,7 +1,7 @@
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
; PR2503
- at g_3 = external global i8 ; <i8*> [#uses=2]
+ at g_3 = external global i8 ; <ptr> [#uses=2]
define i8 @func_1(i32 %x, i32 %y) nounwind {
entry:
@@ -13,8 +13,8 @@ ifthen: ; preds = %entry
br label %ifend
ifelse: ; preds = %entry
- %tmp3 = load i8, i8* @g_3 ; <i8> [#uses=0]
- store i8 %tmp3, i8* %A
+ %tmp3 = load i8, ptr @g_3 ; <i8> [#uses=0]
+ store i8 %tmp3, ptr %A
br label %afterfor
forcond: ; preds = %forinc
@@ -27,7 +27,7 @@ forinc: ; preds = %forbody
br label %forcond
afterfor: ; preds = %forcond, %forcond.thread
- %tmp10 = load i8, i8* @g_3 ; <i8> [#uses=0]
+ %tmp10 = load i8, ptr @g_3 ; <i8> [#uses=0]
ret i8 %tmp10
; CHECK: ret i8 %tmp3
diff --git a/llvm/test/Transforms/NewGVN/2008-12-09-SelfRemove.ll b/llvm/test/Transforms/NewGVN/2008-12-09-SelfRemove.ll
index 4a55ef6872dc..a2e252d065d2 100644
--- a/llvm/test/Transforms/NewGVN/2008-12-09-SelfRemove.ll
+++ b/llvm/test/Transforms/NewGVN/2008-12-09-SelfRemove.ll
@@ -2,20 +2,20 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin9.5"
- %struct.anon = type { i8*, i32 }
- %struct.d_print_info = type { i32, i8*, i32, i32, %struct.d_print_template*, %struct.d_print_mod*, i32 }
- %struct.d_print_mod = type { %struct.d_print_mod*, %struct.demangle_component*, i32, %struct.d_print_template* }
- %struct.d_print_template = type { %struct.d_print_template*, %struct.demangle_component* }
+ %struct.anon = type { ptr, i32 }
+ %struct.d_print_info = type { i32, ptr, i32, i32, ptr, ptr, i32 }
+ %struct.d_print_mod = type { ptr, ptr, i32, ptr }
+ %struct.d_print_template = type { ptr, ptr }
%struct.demangle_component = type { i32, { %struct.anon } }
-define void @d_print_mod_list(%struct.d_print_info* %dpi, %struct.d_print_mod* %mods, i32 %suffix) nounwind {
+define void @d_print_mod_list(ptr %dpi, ptr %mods, i32 %suffix) nounwind {
entry:
- %0 = getelementptr %struct.d_print_info, %struct.d_print_info* %dpi, i32 0, i32 1 ; <i8**> [#uses=1]
+ %0 = getelementptr %struct.d_print_info, ptr %dpi, i32 0, i32 1 ; <ptr> [#uses=1]
br i1 false, label %return, label %bb
bb: ; preds = %entry
- %1 = load i8*, i8** %0, align 4 ; <i8*> [#uses=0]
- %2 = getelementptr %struct.d_print_info, %struct.d_print_info* %dpi, i32 0, i32 1 ; <i8**> [#uses=0]
+ %1 = load ptr, ptr %0, align 4 ; <ptr> [#uses=0]
+ %2 = getelementptr %struct.d_print_info, ptr %dpi, i32 0, i32 1 ; <ptr> [#uses=0]
br label %bb21
bb21: ; preds = %bb21, %bb
@@ -25,9 +25,9 @@ return: ; preds = %entry
ret void
}
-; CHECK: define void @d_print_mod_list(%struct.d_print_info* %dpi, %struct.d_print_mod* %mods, i32 %suffix) #0 {
+; CHECK: define void @d_print_mod_list(ptr %dpi, ptr %mods, i32 %suffix) #0 {
; CHECK: entry:
-; CHECK: %0 = getelementptr %struct.d_print_info, %struct.d_print_info* %dpi, i32 0, i32 1
+; CHECK: %0 = getelementptr %struct.d_print_info, ptr %dpi, i32 0, i32 1
; CHECK: br i1 false, label %return, label %bb
; CHECK: bb:
; CHECK: br label %bb21
diff --git a/llvm/test/Transforms/NewGVN/2008-12-12-RLE-Crash.ll b/llvm/test/Transforms/NewGVN/2008-12-12-RLE-Crash.ll
index dfe82fdb1c72..bb51f72752a2 100644
--- a/llvm/test/Transforms/NewGVN/2008-12-12-RLE-Crash.ll
+++ b/llvm/test/Transforms/NewGVN/2008-12-12-RLE-Crash.ll
@@ -2,13 +2,13 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin7"
-define i32 @main(i32 %argc, i8** %argv) nounwind {
+define i32 @main(i32 %argc, ptr %argv) nounwind {
entry:
br label %bb84
bb41: ; preds = %bb82
- %tmp = load i8, i8* %opt.0, align 1 ; <i8> [#uses=0]
- %tmp1 = getelementptr i8, i8* %opt.0, i32 1 ; <i8*> [#uses=2]
+ %tmp = load i8, ptr %opt.0, align 1 ; <i8> [#uses=0]
+ %tmp1 = getelementptr i8, ptr %opt.0, i32 1 ; <ptr> [#uses=2]
switch i32 0, label %bb81 [
i32 102, label %bb82
i32 110, label %bb79
@@ -25,11 +25,11 @@ bb81: ; preds = %bb41
ret i32 1
bb82: ; preds = %bb84, %bb79, %bb41
- %opt.0 = phi i8* [ %tmp3, %bb84 ], [ %tmp1, %bb79 ], [ %tmp1, %bb41 ] ; <i8*> [#uses=3]
- %tmp2 = load i8, i8* %opt.0, align 1 ; <i8> [#uses=0]
+ %opt.0 = phi ptr [ %tmp3, %bb84 ], [ %tmp1, %bb79 ], [ %tmp1, %bb41 ] ; <ptr> [#uses=3]
+ %tmp2 = load i8, ptr %opt.0, align 1 ; <i8> [#uses=0]
br i1 false, label %bb84, label %bb41
bb84: ; preds = %bb82, %entry
- %tmp3 = getelementptr i8, i8* null, i32 1 ; <i8*> [#uses=1]
+ %tmp3 = getelementptr i8, ptr null, i32 1 ; <ptr> [#uses=1]
br label %bb82
}
diff --git a/llvm/test/Transforms/NewGVN/2008-12-14-rle-reanalyze.ll b/llvm/test/Transforms/NewGVN/2008-12-14-rle-reanalyze.ll
index 5973b5464abb..38d1240fd6a2 100644
--- a/llvm/test/Transforms/NewGVN/2008-12-14-rle-reanalyze.ll
+++ b/llvm/test/Transforms/NewGVN/2008-12-14-rle-reanalyze.ll
@@ -1,7 +1,7 @@
; RUN: opt < %s -passes=newgvn | llvm-dis
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin7"
- at sort_value = external global [256 x i32], align 32 ; <[256 x i32]*> [#uses=2]
+ at sort_value = external global [256 x i32], align 32 ; <ptr> [#uses=2]
define i32 @Quiesce(i32 %alpha, i32 %beta, i32 %wtm, i32 %ply) nounwind {
entry:
@@ -11,8 +11,8 @@ bb22: ; preds = %bb23, %bb22, %entry
br i1 false, label %bb23, label %bb22
bb23: ; preds = %bb23, %bb22
- %sortv.233 = phi i32* [ getelementptr ([256 x i32], [256 x i32]* @sort_value, i32 0, i32 0), %bb22 ], [ %sortv.2, %bb23 ] ; <i32*> [#uses=1]
- %0 = load i32, i32* %sortv.233, align 4 ; <i32> [#uses=0]
- %sortv.2 = getelementptr [256 x i32], [256 x i32]* @sort_value, i32 0, i32 0 ; <i32*> [#uses=1]
+ %sortv.233 = phi ptr [ @sort_value, %bb22 ], [ %sortv.2, %bb23 ] ; <ptr> [#uses=1]
+ %0 = load i32, ptr %sortv.233, align 4 ; <i32> [#uses=0]
+ %sortv.2 = getelementptr [256 x i32], ptr @sort_value, i32 0, i32 0 ; <ptr> [#uses=1]
br i1 false, label %bb23, label %bb22
}
diff --git a/llvm/test/Transforms/NewGVN/2008-12-15-CacheVisited.ll b/llvm/test/Transforms/NewGVN/2008-12-15-CacheVisited.ll
index dd4af61b32c5..0b1761da0c33 100644
--- a/llvm/test/Transforms/NewGVN/2008-12-15-CacheVisited.ll
+++ b/llvm/test/Transforms/NewGVN/2008-12-15-CacheVisited.ll
@@ -2,7 +2,7 @@
; Cached results must be added to and verified against the visited sets.
; PR3217
-define fastcc void @gen_field_die(i32* %decl) nounwind {
+define fastcc void @gen_field_die(ptr %decl) nounwind {
entry:
br i1 false, label %bb203, label %bb202
@@ -10,19 +10,19 @@ bb202: ; preds = %entry
unreachable
bb203: ; preds = %entry
- %tmp = getelementptr i32, i32* %decl, i32 1 ; <i32*> [#uses=1]
- %tmp1 = load i32, i32* %tmp, align 4 ; <i32> [#uses=0]
+ %tmp = getelementptr i32, ptr %decl, i32 1 ; <ptr> [#uses=1]
+ %tmp1 = load i32, ptr %tmp, align 4 ; <i32> [#uses=0]
br i1 false, label %bb207, label %bb204
bb204: ; preds = %bb203
- %tmp2 = getelementptr i32, i32* %decl, i32 1 ; <i32*> [#uses=1]
+ %tmp2 = getelementptr i32, ptr %decl, i32 1 ; <ptr> [#uses=1]
br label %bb208
bb207: ; preds = %bb203
br label %bb208
bb208: ; preds = %bb207, %bb204
- %iftmp.1374.0.in = phi i32* [ null, %bb207 ], [ %tmp2, %bb204 ] ; <i32*> [#uses=1]
- %iftmp.1374.0 = load i32, i32* %iftmp.1374.0.in ; <i32> [#uses=0]
+ %iftmp.1374.0.in = phi ptr [ null, %bb207 ], [ %tmp2, %bb204 ] ; <ptr> [#uses=1]
+ %iftmp.1374.0 = load i32, ptr %iftmp.1374.0.in ; <i32> [#uses=0]
unreachable
}
diff --git a/llvm/test/Transforms/NewGVN/2009-01-21-SortInvalidation.ll b/llvm/test/Transforms/NewGVN/2009-01-21-SortInvalidation.ll
index e61c16138713..8631cbd82f5d 100644
--- a/llvm/test/Transforms/NewGVN/2009-01-21-SortInvalidation.ll
+++ b/llvm/test/Transforms/NewGVN/2009-01-21-SortInvalidation.ll
@@ -2,10 +2,10 @@
; PR3358
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-unknown-linux-gnu"
- %struct.re_pattern_buffer = type { i8*, i64, i64, i64, i8*, i8*, i64, i8 }
- %struct.re_registers = type { i32, i32*, i32* }
+ %struct.re_pattern_buffer = type { ptr, i64, i64, i64, ptr, ptr, i64, i8 }
+ %struct.re_registers = type { i32, ptr, ptr }
-define fastcc i32 @byte_re_match_2_internal(%struct.re_pattern_buffer* nocapture %bufp, i8* %string1, i32 %size1, i8* %string2, i32 %size2, i32 %pos, %struct.re_registers* %regs, i32 %stop) nounwind {
+define fastcc i32 @byte_re_match_2_internal(ptr nocapture %bufp, ptr %string1, i32 %size1, ptr %string2, i32 %size2, i32 %pos, ptr %regs, i32 %stop) nounwind {
entry:
br label %bb159
@@ -13,7 +13,7 @@ succeed_label: ; preds = %bb159
ret i32 0
bb159: ; preds = %bb664, %bb554, %bb159, %bb159, %bb159, %entry
- %d.0 = phi i8* [ null, %entry ], [ %d.0, %bb159 ], [ %d.0, %bb554 ], [ %d.0, %bb159 ], [ %d.0, %bb159 ], [ %d.12, %bb664 ] ; <i8*> [#uses=5]
+ %d.0 = phi ptr [ null, %entry ], [ %d.0, %bb159 ], [ %d.0, %bb554 ], [ %d.0, %bb159 ], [ %d.0, %bb159 ], [ %d.12, %bb664 ] ; <ptr> [#uses=5]
switch i32 0, label %bb661 [
i32 0, label %bb159
i32 1, label %succeed_label
@@ -37,7 +37,7 @@ bb550: ; preds = %bb543
br i1 false, label %bb554, label %bb552
bb552: ; preds = %bb550
- %0 = load i8, i8* %d.0, align 8 ; <i8> [#uses=0]
+ %0 = load i8, ptr %d.0, align 8 ; <i8> [#uses=0]
br label %bb554
bb554: ; preds = %bb552, %bb550, %bb549
@@ -47,7 +47,7 @@ bb622: ; preds = %bb622, %bb159
br label %bb622
bb661: ; preds = %bb554, %bb159
- %d.12 = select i1 false, i8* null, i8* null ; <i8*> [#uses=1]
+ %d.12 = select i1 false, ptr null, ptr null ; <ptr> [#uses=1]
br label %bb664
bb664: ; preds = %bb664, %bb661
diff --git a/llvm/test/Transforms/NewGVN/2009-01-22-SortInvalidation.ll b/llvm/test/Transforms/NewGVN/2009-01-22-SortInvalidation.ll
index 72343445f093..d8871700df6d 100644
--- a/llvm/test/Transforms/NewGVN/2009-01-22-SortInvalidation.ll
+++ b/llvm/test/Transforms/NewGVN/2009-01-22-SortInvalidation.ll
@@ -2,76 +2,76 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin7"
- %struct..4sPragmaType = type { i8*, i32 }
- %struct.AggInfo = type { i8, i8, i32, %struct.ExprList*, i32, %struct.AggInfo_col*, i32, i32, i32, %struct.AggInfo_func*, i32, i32 }
- %struct.AggInfo_col = type { %struct.Table*, i32, i32, i32, i32, %struct.Expr* }
- %struct.AggInfo_func = type { %struct.Expr*, %struct.FuncDef*, i32, i32 }
- %struct.AuxData = type { i8*, void (i8*)* }
+ %struct..4sPragmaType = type { ptr, i32 }
+ %struct.AggInfo = type { i8, i8, i32, ptr, i32, ptr, i32, i32, i32, ptr, i32, i32 }
+ %struct.AggInfo_col = type { ptr, i32, i32, i32, i32, ptr }
+ %struct.AggInfo_func = type { ptr, ptr, i32, i32 }
+ %struct.AuxData = type { ptr, ptr }
%struct.Bitvec = type { i32, i32, i32, { [125 x i32] } }
- %struct.BtCursor = type { %struct.Btree*, %struct.BtShared*, %struct.BtCursor*, %struct.BtCursor*, i32 (i8*, i32, i8*, i32, i8*)*, i8*, i32, %struct.MemPage*, i32, %struct.CellInfo, i8, i8, i8*, i64, i32, i8, i32* }
- %struct.BtLock = type { %struct.Btree*, i32, i8, %struct.BtLock* }
- %struct.BtShared = type { %struct.Pager*, %struct.sqlite3*, %struct.BtCursor*, %struct.MemPage*, i8, i8, i8, i8, i8, i8, i8, i8, i32, i16, i16, i32, i32, i32, i32, i8, i32, i8*, void (i8*)*, %struct.sqlite3_mutex*, %struct.BusyHandler, i32, %struct.BtShared*, %struct.BtLock*, %struct.Btree* }
- %struct.Btree = type { %struct.sqlite3*, %struct.BtShared*, i8, i8, i8, i32, %struct.Btree*, %struct.Btree* }
- %struct.BtreeMutexArray = type { i32, [11 x %struct.Btree*] }
- %struct.BusyHandler = type { i32 (i8*, i32)*, i8*, i32 }
- %struct.CellInfo = type { i8*, i64, i32, i32, i16, i16, i16, i16 }
- %struct.CollSeq = type { i8*, i8, i8, i8*, i32 (i8*, i32, i8*, i32, i8*)*, void (i8*)* }
- %struct.Column = type { i8*, %struct.Expr*, i8*, i8*, i8, i8, i8, i8 }
+ %struct.BtCursor = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, i32, %struct.CellInfo, i8, i8, ptr, i64, i32, i8, ptr }
+ %struct.BtLock = type { ptr, i32, i8, ptr }
+ %struct.BtShared = type { ptr, ptr, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, i8, i32, i16, i16, i32, i32, i32, i32, i8, i32, ptr, ptr, ptr, %struct.BusyHandler, i32, ptr, ptr, ptr }
+ %struct.Btree = type { ptr, ptr, i8, i8, i8, i32, ptr, ptr }
+ %struct.BtreeMutexArray = type { i32, [11 x ptr] }
+ %struct.BusyHandler = type { ptr, ptr, i32 }
+ %struct.CellInfo = type { ptr, i64, i32, i32, i16, i16, i16, i16 }
+ %struct.CollSeq = type { ptr, i8, i8, ptr, ptr, ptr }
+ %struct.Column = type { ptr, ptr, ptr, ptr, i8, i8, i8, i8 }
%struct.Context = type { i64, i32, %struct.Fifo }
%struct.CountCtx = type { i64 }
- %struct.Cursor = type { %struct.BtCursor*, i32, i64, i64, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i64, %struct.Btree*, i32, i8*, i64, i8*, %struct.KeyInfo*, i32, i64, %struct.sqlite3_vtab_cursor*, %struct.sqlite3_module*, i32, i32, i32*, i32*, i8* }
- %struct.Db = type { i8*, %struct.Btree*, i8, i8, i8*, void (i8*)*, %struct.Schema* }
- %struct.Expr = type { i8, i8, i16, %struct.CollSeq*, %struct.Expr*, %struct.Expr*, %struct.ExprList*, %struct..4sPragmaType, %struct..4sPragmaType, i32, i32, %struct.AggInfo*, i32, i32, %struct.Select*, %struct.Table*, i32 }
- %struct.ExprList = type { i32, i32, i32, %struct.ExprList_item* }
- %struct.ExprList_item = type { %struct.Expr*, i8*, i8, i8, i8 }
- %struct.FKey = type { %struct.Table*, %struct.FKey*, i8*, %struct.FKey*, i32, %struct.sColMap*, i8, i8, i8, i8 }
- %struct.Fifo = type { i32, %struct.FifoPage*, %struct.FifoPage* }
- %struct.FifoPage = type { i32, i32, i32, %struct.FifoPage*, [1 x i64] }
- %struct.FuncDef = type { i16, i8, i8, i8, i8*, %struct.FuncDef*, void (%struct.sqlite3_context*, i32, %struct.Mem**)*, void (%struct.sqlite3_context*, i32, %struct.Mem**)*, void (%struct.sqlite3_context*)*, [1 x i8] }
- %struct.Hash = type { i8, i8, i32, i32, %struct.HashElem*, %struct._ht* }
- %struct.HashElem = type { %struct.HashElem*, %struct.HashElem*, i8*, i8*, i32 }
- %struct.IdList = type { %struct..4sPragmaType*, i32, i32 }
- %struct.Index = type { i8*, i32, i32*, i32*, %struct.Table*, i32, i8, i8, i8*, %struct.Index*, %struct.Schema*, i8*, i8** }
- %struct.KeyInfo = type { %struct.sqlite3*, i8, i8, i8, i32, i8*, [1 x %struct.CollSeq*] }
- %struct.Mem = type { %struct.CountCtx, double, %struct.sqlite3*, i8*, i32, i16, i8, i8, void (i8*)* }
- %struct.MemPage = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i16, i16, i16, i16, i16, [5 x %struct._OvflCell], %struct.BtShared*, i8*, %struct.PgHdr*, i32, %struct.MemPage* }
- %struct.Module = type { %struct.sqlite3_module*, i8*, i8*, void (i8*)* }
+ %struct.Cursor = type { ptr, i32, i64, i64, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i64, ptr, i32, ptr, i64, ptr, ptr, i32, i64, ptr, ptr, i32, i32, ptr, ptr, ptr }
+ %struct.Db = type { ptr, ptr, i8, i8, ptr, ptr, ptr }
+ %struct.Expr = type { i8, i8, i16, ptr, ptr, ptr, ptr, %struct..4sPragmaType, %struct..4sPragmaType, i32, i32, ptr, i32, i32, ptr, ptr, i32 }
+ %struct.ExprList = type { i32, i32, i32, ptr }
+ %struct.ExprList_item = type { ptr, ptr, i8, i8, i8 }
+ %struct.FKey = type { ptr, ptr, ptr, ptr, i32, ptr, i8, i8, i8, i8 }
+ %struct.Fifo = type { i32, ptr, ptr }
+ %struct.FifoPage = type { i32, i32, i32, ptr, [1 x i64] }
+ %struct.FuncDef = type { i16, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, [1 x i8] }
+ %struct.Hash = type { i8, i8, i32, i32, ptr, ptr }
+ %struct.HashElem = type { ptr, ptr, ptr, ptr, i32 }
+ %struct.IdList = type { ptr, i32, i32 }
+ %struct.Index = type { ptr, i32, ptr, ptr, ptr, i32, i8, i8, ptr, ptr, ptr, ptr, ptr }
+ %struct.KeyInfo = type { ptr, i8, i8, i8, i32, ptr, [1 x ptr] }
+ %struct.Mem = type { %struct.CountCtx, double, ptr, ptr, i32, i16, i8, i8, ptr }
+ %struct.MemPage = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i16, i16, i16, i16, i16, [5 x %struct._OvflCell], ptr, ptr, ptr, i32, ptr }
+ %struct.Module = type { ptr, ptr, ptr, ptr }
%struct.Op = type { i8, i8, i8, i8, i32, i32, i32, { i32 } }
- %struct.Pager = type { %struct.sqlite3_vfs*, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.Bitvec*, %struct.Bitvec*, i8*, i8*, i8*, i8*, %struct.sqlite3_file*, %struct.sqlite3_file*, %struct.sqlite3_file*, %struct.BusyHandler*, %struct.PagerLruList, %struct.PgHdr*, %struct.PgHdr*, %struct.PgHdr*, i64, i64, i64, i64, i64, i32, void (%struct.PgHdr*, i32)*, void (%struct.PgHdr*, i32)*, i32, %struct.PgHdr**, i8*, [16 x i8] }
- %struct.PagerLruLink = type { %struct.PgHdr*, %struct.PgHdr* }
- %struct.PagerLruList = type { %struct.PgHdr*, %struct.PgHdr*, %struct.PgHdr* }
- %struct.Parse = type { %struct.sqlite3*, i32, i8*, %struct.Vdbe*, i8, i8, i8, i8, i8, i8, i8, [8 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [12 x i32], i32, %struct.TableLock*, i32, i32, i32, i32, i32, %struct.Expr**, i8, %struct..4sPragmaType, %struct..4sPragmaType, %struct..4sPragmaType, i8*, i8*, %struct.Table*, %struct.Trigger*, %struct.TriggerStack*, i8*, %struct..4sPragmaType, i8, %struct.Table*, i32 }
- %struct.PgHdr = type { %struct.Pager*, i32, %struct.PgHdr*, %struct.PgHdr*, %struct.PagerLruLink, %struct.PgHdr*, i8, i8, i8, i8, i8, i16, %struct.PgHdr*, %struct.PgHdr*, i8* }
- %struct.Schema = type { i32, %struct.Hash, %struct.Hash, %struct.Hash, %struct.Hash, %struct.Table*, i8, i8, i16, i32, %struct.sqlite3* }
- %struct.Select = type { %struct.ExprList*, i8, i8, i8, i8, i8, i8, i8, %struct.SrcList*, %struct.Expr*, %struct.ExprList*, %struct.Expr*, %struct.ExprList*, %struct.Select*, %struct.Select*, %struct.Select*, %struct.Expr*, %struct.Expr*, i32, i32, [3 x i32] }
+ %struct.Pager = type { ptr, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.PagerLruList, ptr, ptr, ptr, i64, i64, i64, i64, i64, i32, ptr, ptr, i32, ptr, ptr, [16 x i8] }
+ %struct.PagerLruLink = type { ptr, ptr }
+ %struct.PagerLruList = type { ptr, ptr, ptr }
+ %struct.Parse = type { ptr, i32, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, [8 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [12 x i32], i32, ptr, i32, i32, i32, i32, i32, ptr, i8, %struct..4sPragmaType, %struct..4sPragmaType, %struct..4sPragmaType, ptr, ptr, ptr, ptr, ptr, ptr, %struct..4sPragmaType, i8, ptr, i32 }
+ %struct.PgHdr = type { ptr, i32, ptr, ptr, %struct.PagerLruLink, ptr, i8, i8, i8, i8, i8, i16, ptr, ptr, ptr }
+ %struct.Schema = type { i32, %struct.Hash, %struct.Hash, %struct.Hash, %struct.Hash, ptr, i8, i8, i16, i32, ptr }
+ %struct.Select = type { ptr, i8, i8, i8, i8, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, [3 x i32] }
%struct.SrcList = type { i16, i16, [1 x %struct.SrcList_item] }
- %struct.SrcList_item = type { i8*, i8*, i8*, %struct.Table*, %struct.Select*, i8, i8, i32, %struct.Expr*, %struct.IdList*, i64 }
- %struct.Table = type { i8*, i32, %struct.Column*, i32, %struct.Index*, i32, %struct.Select*, i32, %struct.Trigger*, %struct.FKey*, i8*, %struct.Expr*, i32, i8, i8, i8, i8, i8, i8, i8, %struct.Module*, %struct.sqlite3_vtab*, i32, i8**, %struct.Schema* }
- %struct.TableLock = type { i32, i32, i8, i8* }
- %struct.Trigger = type { i8*, i8*, i8, i8, %struct.Expr*, %struct.IdList*, %struct..4sPragmaType, %struct.Schema*, %struct.Schema*, %struct.TriggerStep*, %struct.Trigger* }
- %struct.TriggerStack = type { %struct.Table*, i32, i32, i32, i32, i32, i32, %struct.Trigger*, %struct.TriggerStack* }
- %struct.TriggerStep = type { i32, i32, %struct.Trigger*, %struct.Select*, %struct..4sPragmaType, %struct.Expr*, %struct.ExprList*, %struct.IdList*, %struct.TriggerStep*, %struct.TriggerStep* }
- %struct.Vdbe = type { %struct.sqlite3*, %struct.Vdbe*, %struct.Vdbe*, i32, i32, %struct.Op*, i32, i32, i32*, %struct.Mem**, %struct.Mem*, i32, %struct.Cursor**, i32, %struct.Mem*, i8**, i32, i32, i32, %struct.Mem*, i32, i32, %struct.Fifo, i32, i32, %struct.Context*, i32, i32, i32, i32, i32, [25 x i32], i32, i32, i8**, i8*, %struct.Mem*, i8, i8, i8, i8, i8, i8, i32, i64, i32, %struct.BtreeMutexArray, i32, i8*, i32 }
- %struct.VdbeFunc = type { %struct.FuncDef*, i32, [1 x %struct.AuxData] }
- %struct._OvflCell = type { i8*, i16 }
- %struct._ht = type { i32, %struct.HashElem* }
+ %struct.SrcList_item = type { ptr, ptr, ptr, ptr, ptr, i8, i8, i32, ptr, ptr, i64 }
+ %struct.Table = type { ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, ptr, ptr, i32, i8, i8, i8, i8, i8, i8, i8, ptr, ptr, i32, ptr, ptr }
+ %struct.TableLock = type { i32, i32, i8, ptr }
+ %struct.Trigger = type { ptr, ptr, i8, i8, ptr, ptr, %struct..4sPragmaType, ptr, ptr, ptr, ptr }
+ %struct.TriggerStack = type { ptr, i32, i32, i32, i32, i32, i32, ptr, ptr }
+ %struct.TriggerStep = type { i32, i32, ptr, ptr, %struct..4sPragmaType, ptr, ptr, ptr, ptr, ptr }
+ %struct.Vdbe = type { ptr, ptr, ptr, i32, i32, ptr, i32, i32, ptr, ptr, ptr, i32, ptr, i32, ptr, ptr, i32, i32, i32, ptr, i32, i32, %struct.Fifo, i32, i32, ptr, i32, i32, i32, i32, i32, [25 x i32], i32, i32, ptr, ptr, ptr, i8, i8, i8, i8, i8, i8, i32, i64, i32, %struct.BtreeMutexArray, i32, ptr, i32 }
+ %struct.VdbeFunc = type { ptr, i32, [1 x %struct.AuxData] }
+ %struct._OvflCell = type { ptr, i16 }
+ %struct._ht = type { i32, ptr }
%struct.anon = type { double }
- %struct.sColMap = type { i32, i8* }
- %struct.sqlite3 = type { %struct.sqlite3_vfs*, i32, %struct.Db*, i32, i32, i32, i32, i8, i8, i8, i8, i32, %struct.CollSeq*, i64, i64, i32, i32, i32, %struct.sqlite3_mutex*, %struct.sqlite3InitInfo, i32, i8**, %struct.Vdbe*, i32, void (i8*, i8*)*, i8*, void (i8*, i8*, i64)*, i8*, i8*, i32 (i8*)*, i8*, void (i8*)*, i8*, void (i8*, i32, i8*, i8*, i64)*, void (i8*, %struct.sqlite3*, i32, i8*)*, void (i8*, %struct.sqlite3*, i32, i8*)*, i8*, %struct.Mem*, i8*, i8*, %struct.anon, i32 (i8*, i32, i8*, i8*, i8*, i8*)*, i8*, i32 (i8*)*, i8*, i32, %struct.Hash, %struct.Table*, %struct.sqlite3_vtab**, i32, %struct.Hash, %struct.Hash, %struct.BusyHandler, i32, [2 x %struct.Db], i8 }
+ %struct.sColMap = type { i32, ptr }
+ %struct.sqlite3 = type { ptr, i32, ptr, i32, i32, i32, i32, i8, i8, i8, i8, i32, ptr, i64, i64, i32, i32, i32, ptr, %struct.sqlite3InitInfo, i32, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.anon, ptr, ptr, ptr, ptr, i32, %struct.Hash, ptr, ptr, i32, %struct.Hash, %struct.Hash, %struct.BusyHandler, i32, [2 x %struct.Db], i8 }
%struct.sqlite3InitInfo = type { i32, i32, i8 }
- %struct.sqlite3_context = type { %struct.FuncDef*, %struct.VdbeFunc*, %struct.Mem, %struct.Mem*, i32, %struct.CollSeq* }
- %struct.sqlite3_file = type { %struct.sqlite3_io_methods* }
+ %struct.sqlite3_context = type { ptr, ptr, %struct.Mem, ptr, i32, ptr }
+ %struct.sqlite3_file = type { ptr }
%struct.sqlite3_index_constraint = type { i32, i8, i8, i32 }
%struct.sqlite3_index_constraint_usage = type { i32, i8 }
- %struct.sqlite3_index_info = type { i32, %struct.sqlite3_index_constraint*, i32, %struct.sqlite3_index_constraint_usage*, %struct.sqlite3_index_constraint_usage*, i32, i8*, i32, i32, double }
- %struct.sqlite3_io_methods = type { i32, i32 (%struct.sqlite3_file*)*, i32 (%struct.sqlite3_file*, i8*, i32, i64)*, i32 (%struct.sqlite3_file*, i8*, i32, i64)*, i32 (%struct.sqlite3_file*, i64)*, i32 (%struct.sqlite3_file*, i32)*, i32 (%struct.sqlite3_file*, i64*)*, i32 (%struct.sqlite3_file*, i32)*, i32 (%struct.sqlite3_file*, i32)*, i32 (%struct.sqlite3_file*)*, i32 (%struct.sqlite3_file*, i32, i8*)*, i32 (%struct.sqlite3_file*)*, i32 (%struct.sqlite3_file*)* }
- %struct.sqlite3_module = type { i32, i32 (%struct.sqlite3*, i8*, i32, i8**, %struct.sqlite3_vtab**, i8**)*, i32 (%struct.sqlite3*, i8*, i32, i8**, %struct.sqlite3_vtab**, i8**)*, i32 (%struct.sqlite3_vtab*, %struct.sqlite3_index_info*)*, i32 (%struct.sqlite3_vtab*)*, i32 (%struct.sqlite3_vtab*)*, i32 (%struct.sqlite3_vtab*, %struct.sqlite3_vtab_cursor**)*, i32 (%struct.sqlite3_vtab_cursor*)*, i32 (%struct.sqlite3_vtab_cursor*, i32, i8*, i32, %struct.Mem**)*, i32 (%struct.sqlite3_vtab_cursor*)*, i32 (%struct.sqlite3_vtab_cursor*)*, i32 (%struct.sqlite3_vtab_cursor*, %struct.sqlite3_context*, i32)*, i32 (%struct.sqlite3_vtab_cursor*, i64*)*, i32 (%struct.sqlite3_vtab*, i32, %struct.Mem**, i64*)*, i32 (%struct.sqlite3_vtab*)*, i32 (%struct.sqlite3_vtab*)*, i32 (%struct.sqlite3_vtab*)*, i32 (%struct.sqlite3_vtab*)*, i32 (%struct.sqlite3_vtab*, i32, i8*, void (%struct.sqlite3_context*, i32, %struct.Mem**)**, i8**)*, i32 (%struct.sqlite3_vtab*, i8*)* }
+ %struct.sqlite3_index_info = type { i32, ptr, i32, ptr, ptr, i32, ptr, i32, i32, double }
+ %struct.sqlite3_io_methods = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
+ %struct.sqlite3_module = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.sqlite3_mutex = type opaque
- %struct.sqlite3_vfs = type { i32, i32, i32, %struct.sqlite3_vfs*, i8*, i8*, i32 (%struct.sqlite3_vfs*, i8*, %struct.sqlite3_file*, i32, i32*)*, i32 (%struct.sqlite3_vfs*, i8*, i32)*, i32 (%struct.sqlite3_vfs*, i8*, i32)*, i32 (%struct.sqlite3_vfs*, i32, i8*)*, i32 (%struct.sqlite3_vfs*, i8*, i32, i8*)*, i8* (%struct.sqlite3_vfs*, i8*)*, void (%struct.sqlite3_vfs*, i32, i8*)*, i8* (%struct.sqlite3_vfs*, i8*, i8*)*, void (%struct.sqlite3_vfs*, i8*)*, i32 (%struct.sqlite3_vfs*, i32, i8*)*, i32 (%struct.sqlite3_vfs*, i32)*, i32 (%struct.sqlite3_vfs*, double*)* }
- %struct.sqlite3_vtab = type { %struct.sqlite3_module*, i32, i8* }
- %struct.sqlite3_vtab_cursor = type { %struct.sqlite3_vtab* }
+ %struct.sqlite3_vfs = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
+ %struct.sqlite3_vtab = type { ptr, i32, ptr }
+ %struct.sqlite3_vtab_cursor = type { ptr }
-define fastcc void @sqlite3Insert(%struct.Parse* %pParse, %struct.SrcList* %pTabList, %struct.ExprList* %pList, %struct.Select* %pSelect, %struct.IdList* %pColumn, i32 %onError) nounwind {
+define fastcc void @sqlite3Insert(ptr %pParse, ptr %pTabList, ptr %pList, ptr %pSelect, ptr %pColumn, i32 %onError) nounwind {
entry:
br i1 false, label %bb54, label %bb69.loopexit
@@ -79,20 +79,20 @@ bb54: ; preds = %entry
br label %bb69.loopexit
bb59: ; preds = %bb63.preheader
- %0 = load %struct..4sPragmaType*, %struct..4sPragmaType** %3, align 4 ; <%struct..4sPragmaType*> [#uses=0]
+ %0 = load ptr, ptr %3, align 4 ; <ptr> [#uses=0]
br label %bb65
bb65: ; preds = %bb63.preheader, %bb59
- %1 = load %struct..4sPragmaType*, %struct..4sPragmaType** %4, align 4 ; <%struct..4sPragmaType*> [#uses=0]
+ %1 = load ptr, ptr %4, align 4 ; <ptr> [#uses=0]
br i1 false, label %bb67, label %bb63.preheader
bb67: ; preds = %bb65
- %2 = getelementptr %struct.IdList, %struct.IdList* %pColumn, i32 0, i32 0 ; <%struct..4sPragmaType**> [#uses=0]
+ %2 = getelementptr %struct.IdList, ptr %pColumn, i32 0, i32 0 ; <ptr> [#uses=0]
unreachable
bb69.loopexit: ; preds = %bb54, %entry
- %3 = getelementptr %struct.IdList, %struct.IdList* %pColumn, i32 0, i32 0 ; <%struct..4sPragmaType**> [#uses=1]
- %4 = getelementptr %struct.IdList, %struct.IdList* %pColumn, i32 0, i32 0 ; <%struct..4sPragmaType**> [#uses=1]
+ %3 = getelementptr %struct.IdList, ptr %pColumn, i32 0, i32 0 ; <ptr> [#uses=1]
+ %4 = getelementptr %struct.IdList, ptr %pColumn, i32 0, i32 0 ; <ptr> [#uses=1]
br label %bb63.preheader
bb63.preheader: ; preds = %bb69.loopexit, %bb65
diff --git a/llvm/test/Transforms/NewGVN/2009-03-10-PREOnVoid.ll b/llvm/test/Transforms/NewGVN/2009-03-10-PREOnVoid.ll
index a470e086a893..6aa79e0433d4 100644
--- a/llvm/test/Transforms/NewGVN/2009-03-10-PREOnVoid.ll
+++ b/llvm/test/Transforms/NewGVN/2009-03-10-PREOnVoid.ll
@@ -5,36 +5,36 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"
%llvm.dbg.anchor.type = type { i32, i32 }
- %"struct.__gnu_cxx::hash<void*>" = type <{ i8 }>
+ %"struct.__gnu_cxx::hash<ptr>" = type <{ i8 }>
%struct.__sched_param = type { i32 }
%struct._pthread_descr_struct = type opaque
- %struct.pthread_attr_t = type { i32, i32, %struct.__sched_param, i32, i32, i32, i32, i8*, i32 }
- %struct.pthread_mutex_t = type { i32, i32, %struct._pthread_descr_struct*, i32, %llvm.dbg.anchor.type }
- %"struct.std::_Rb_tree<void*,std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > >,std::_Select1st<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,std::less<void*>,std::allocator<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > > >" = type { %"struct.std::_Rb_tree<void*,std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > >,std::_Select1st<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,std::less<void*>,std::allocator<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > > >::_Rb_tree_impl<std::less<void*>,false>" }
- %"struct.std::_Rb_tree<void*,std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > >,std::_Select1st<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,std::less<void*>,std::allocator<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > > >::_Rb_tree_impl<std::less<void*>,false>" = type { %"struct.__gnu_cxx::hash<void*>", %"struct.std::_Rb_tree_node_base", i32 }
- %"struct.std::_Rb_tree_iterator<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >" = type { %"struct.std::_Rb_tree_node_base"* }
- %"struct.std::_Rb_tree_node_base" = type { i32, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"* }
- %"struct.std::pair<std::_Rb_tree_iterator<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,bool>" = type { %"struct.std::_Rb_tree_iterator<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >", i8 }
- %"struct.std::pair<void* const,void*>" = type { i8*, i8* }
-
- at _ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*), i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
- at _ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32), i8* (i32)* @pthread_getspecific ; <i8* (i32)*> [#uses=0]
- at _ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*), i32 (i32, i8*)* @pthread_setspecific ; <i32 (i32, i8*)*> [#uses=0]
- at _ZL22__gthrw_pthread_createPmPK16__pthread_attr_sPFPvS3_ES3_ = weak alias i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*), i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; <i32 (i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*)*> [#uses=0]
- at _ZL22__gthrw_pthread_cancelm = weak alias i32 (i32), i32 (i32)* @pthread_cancel ; <i32 (i32)*> [#uses=0]
- at _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*), i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
- at _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*), i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
- at _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*), i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; <i32 (%struct.pthread_mutex_t*)*> [#uses=0]
- at _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%struct.pthread_mutex_t*, %struct.__sched_param*), i32 (%struct.pthread_mutex_t*, %struct.__sched_param*)* @pthread_mutex_init ; <i32 (%struct.pthread_mutex_t*, %struct.__sched_param*)*> [#uses=0]
- at _ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*), i32 (i32*, void (i8*)*)* @pthread_key_create ; <i32 (i32*, void (i8*)*)*> [#uses=0]
- at _ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32), i32 (i32)* @pthread_key_delete ; <i32 (i32)*> [#uses=0]
- at _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%struct.__sched_param*), i32 (%struct.__sched_param*)* @pthread_mutexattr_init ; <i32 (%struct.__sched_param*)*> [#uses=0]
- at _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%struct.__sched_param*, i32), i32 (%struct.__sched_param*, i32)* @pthread_mutexattr_settype ; <i32 (%struct.__sched_param*, i32)*> [#uses=0]
- at _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%struct.__sched_param*), i32 (%struct.__sched_param*)* @pthread_mutexattr_destroy ; <i32 (%struct.__sched_param*)*> [#uses=0]
+ %struct.pthread_attr_t = type { i32, i32, %struct.__sched_param, i32, i32, i32, i32, ptr, i32 }
+ %struct.pthread_mutex_t = type { i32, i32, ptr, i32, %llvm.dbg.anchor.type }
+ %"struct.std::_Rb_tree<ptr,std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > >,std::_Select1st<std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,std::less<ptr>,std::allocator<std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > > >" = type { %"struct.std::_Rb_tree<ptr,std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > >,std::_Select1st<std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,std::less<ptr>,std::allocator<std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > > >::_Rb_tree_impl<std::less<ptr>,false>" }
+ %"struct.std::_Rb_tree<ptr,std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > >,std::_Select1st<std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,std::less<ptr>,std::allocator<std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > > >::_Rb_tree_impl<std::less<ptr>,false>" = type { %"struct.__gnu_cxx::hash<ptr>", %"struct.std::_Rb_tree_node_base", i32 }
+ %"struct.std::_Rb_tree_iterator<std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >" = type { ptr }
+ %"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
+ %"struct.std::pair<std::_Rb_tree_iterator<std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,bool>" = type { %"struct.std::_Rb_tree_iterator<std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >", i8 }
+ %"struct.std::pair<ptr const,ptr>" = type { ptr, ptr }
+
+ at _ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (ptr, ptr), ptr @pthread_once ; <ptr> [#uses=0]
+ at _ZL27__gthrw_pthread_getspecificj = weak alias ptr (i32), ptr @pthread_getspecific ; <ptr> [#uses=0]
+ at _ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, ptr), ptr @pthread_setspecific ; <ptr> [#uses=0]
+ at _ZL22__gthrw_pthread_createPmPK16__pthread_attr_sPFPvS3_ES3_ = weak alias i32 (ptr, ptr, ptr, ptr), ptr @pthread_create ; <ptr> [#uses=0]
+ at _ZL22__gthrw_pthread_cancelm = weak alias i32 (i32), ptr @pthread_cancel ; <ptr> [#uses=0]
+ at _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (ptr), ptr @pthread_mutex_lock ; <ptr> [#uses=0]
+ at _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (ptr), ptr @pthread_mutex_trylock ; <ptr> [#uses=0]
+ at _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (ptr), ptr @pthread_mutex_unlock ; <ptr> [#uses=0]
+ at _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (ptr, ptr), ptr @pthread_mutex_init ; <ptr> [#uses=0]
+ at _ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (ptr, ptr), ptr @pthread_key_create ; <ptr> [#uses=0]
+ at _ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32), ptr @pthread_key_delete ; <ptr> [#uses=0]
+ at _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (ptr), ptr @pthread_mutexattr_init ; <ptr> [#uses=0]
+ at _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (ptr, i32), ptr @pthread_mutexattr_settype ; <ptr> [#uses=0]
+ at _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (ptr), ptr @pthread_mutexattr_destroy ; <ptr> [#uses=0]
declare fastcc void @_ZNSt10_Select1stISt4pairIKPvS1_EEC1Ev() nounwind readnone
-define fastcc void @_ZNSt8_Rb_treeIPvSt4pairIKS0_S0_ESt10_Select1stIS3_ESt4lessIS0_ESaIS3_EE16_M_insert_uniqueERKS3_(%"struct.std::pair<std::_Rb_tree_iterator<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,bool>"* noalias nocapture sret(%"struct.std::pair<std::_Rb_tree_iterator<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,bool>") %agg.result, %"struct.std::_Rb_tree<void*,std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > >,std::_Select1st<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,std::less<void*>,std::allocator<std::pair<void* const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > > >"* %this, %"struct.std::pair<void* const,void*>"* %__v) nounwind {
+define fastcc void @_ZNSt8_Rb_treeIPvSt4pairIKS0_S0_ESt10_Select1stIS3_ESt4lessIS0_ESaIS3_EE16_M_insert_uniqueERKS3_(ptr noalias nocapture sret(%"struct.std::pair<std::_Rb_tree_iterator<std::pair<ptr const, std::vector<ShadowInfo, std::allocator<ShadowInfo> > > >,bool>") %agg.result, ptr %this, ptr %__v) nounwind {
entry:
br i1 false, label %bb7, label %bb
@@ -53,19 +53,19 @@ bb11: ; preds = %bb7, %bb5
unreachable
}
-define i32 @pthread_once(i32*, void ()*) {
+define i32 @pthread_once(ptr, ptr) {
ret i32 0
}
-define i8* @pthread_getspecific(i32) {
- ret i8* null
+define ptr @pthread_getspecific(i32) {
+ ret ptr null
}
-define i32 @pthread_setspecific(i32, i8*) {
+define i32 @pthread_setspecific(i32, ptr) {
ret i32 0
}
-define i32 @pthread_create(i32*, %struct.pthread_attr_t*, i8* (i8*)*, i8*) {
+define i32 @pthread_create(ptr, ptr, ptr, ptr) {
ret i32 0
}
@@ -73,23 +73,23 @@ define i32 @pthread_cancel(i32) {
ret i32 0
}
-define i32 @pthread_mutex_lock(%struct.pthread_mutex_t*) {
+define i32 @pthread_mutex_lock(ptr) {
ret i32 0
}
-define i32 @pthread_mutex_trylock(%struct.pthread_mutex_t*) {
+define i32 @pthread_mutex_trylock(ptr) {
ret i32 0
}
-define i32 @pthread_mutex_unlock(%struct.pthread_mutex_t*) {
+define i32 @pthread_mutex_unlock(ptr) {
ret i32 0
}
-define i32 @pthread_mutex_init(%struct.pthread_mutex_t*, %struct.__sched_param*) {
+define i32 @pthread_mutex_init(ptr, ptr) {
ret i32 0
}
-define i32 @pthread_key_create(i32*, void (i8*)*) {
+define i32 @pthread_key_create(ptr, ptr) {
ret i32 0
}
@@ -97,14 +97,14 @@ define i32 @pthread_key_delete(i32) {
ret i32 0
}
-define i32 @pthread_mutexattr_init(%struct.__sched_param*) {
+define i32 @pthread_mutexattr_init(ptr) {
ret i32 0
}
-define i32 @pthread_mutexattr_settype(%struct.__sched_param*, i32) {
+define i32 @pthread_mutexattr_settype(ptr, i32) {
ret i32 0
}
-define i32 @pthread_mutexattr_destroy(%struct.__sched_param*) {
+define i32 @pthread_mutexattr_destroy(ptr) {
ret i32 0
}
diff --git a/llvm/test/Transforms/NewGVN/2009-07-13-MemDepSortFail.ll b/llvm/test/Transforms/NewGVN/2009-07-13-MemDepSortFail.ll
index 1fc324cd73f1..24ad1852780c 100644
--- a/llvm/test/Transforms/NewGVN/2009-07-13-MemDepSortFail.ll
+++ b/llvm/test/Transforms/NewGVN/2009-07-13-MemDepSortFail.ll
@@ -3,11 +3,11 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"
%llvm.dbg.anchor.type = type { i32, i32 }
- %struct.cset = type { i8*, i8, i8, i32, i8* }
- %struct.lmat = type { %struct.re_guts*, i32, %llvm.dbg.anchor.type*, i8*, i8*, i8*, i8*, i8**, i32, i8*, i8*, i8*, i8*, i8* }
- %struct.re_guts = type { i32*, %struct.cset*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, i32, i32, [1 x i8] }
+ %struct.cset = type { ptr, i8, i8, i32, ptr }
+ %struct.lmat = type { ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr }
+ %struct.re_guts = type { ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, i32, i32, [1 x i8] }
-define i8* @lbackref(%struct.lmat* %m, i8* %start, i8* %stop, i32 %startst, i32 %stopst, i32 %lev, i32 %rec) nounwind {
+define ptr @lbackref(ptr %m, ptr %start, ptr %stop, i32 %startst, i32 %stopst, i32 %lev, i32 %rec) nounwind {
entry:
br label %bb63
@@ -22,26 +22,26 @@ bb2: ; preds = %bb
br label %bb62
bb9: ; preds = %bb
- %0 = load i8, i8* %sp.1, align 1 ; <i8> [#uses=0]
+ %0 = load i8, ptr %sp.1, align 1 ; <i8> [#uses=0]
br label %bb62
bb51: ; preds = %bb
- %1 = load i8, i8* %sp.1, align 1 ; <i8> [#uses=0]
- ret i8* null
+ %1 = load i8, ptr %sp.1, align 1 ; <i8> [#uses=0]
+ ret ptr null
bb62: ; preds = %bb9, %bb2, %bb
br label %bb63
bb63: ; preds = %bb84, %bb69, %bb62, %entry
- %sp.1 = phi i8* [ null, %bb62 ], [ %sp.1.lcssa, %bb84 ], [ %start, %entry ], [ %sp.1.lcssa, %bb69 ] ; <i8*> [#uses=3]
+ %sp.1 = phi ptr [ null, %bb62 ], [ %sp.1.lcssa, %bb84 ], [ %start, %entry ], [ %sp.1.lcssa, %bb69 ] ; <ptr> [#uses=3]
br i1 false, label %bb, label %bb65
bb65: ; preds = %bb63
- %sp.1.lcssa = phi i8* [ %sp.1, %bb63 ] ; <i8*> [#uses=4]
+ %sp.1.lcssa = phi ptr [ %sp.1, %bb63 ] ; <ptr> [#uses=4]
br i1 false, label %bb66, label %bb69
bb66: ; preds = %bb65
- ret i8* null
+ ret ptr null
bb69: ; preds = %bb65
switch i32 0, label %bb108.loopexit2.loopexit.loopexit [
@@ -52,16 +52,16 @@ bb69: ; preds = %bb65
]
bb84: ; preds = %bb69
- %2 = tail call i8* @lbackref(%struct.lmat* %m, i8* %sp.1.lcssa, i8* %stop, i32 0, i32 %stopst, i32 0, i32 0) nounwind ; <i8*> [#uses=0]
+ %2 = tail call ptr @lbackref(ptr %m, ptr %sp.1.lcssa, ptr %stop, i32 0, i32 %stopst, i32 0, i32 0) nounwind ; <ptr> [#uses=0]
br label %bb63
bb93: ; preds = %bb69
- ret i8* null
+ ret ptr null
bb104: ; preds = %bb69
- %sp.1.lcssa.lcssa33 = phi i8* [ %sp.1.lcssa, %bb69 ] ; <i8*> [#uses=0]
+ %sp.1.lcssa.lcssa33 = phi ptr [ %sp.1.lcssa, %bb69 ] ; <ptr> [#uses=0]
unreachable
bb108.loopexit2.loopexit.loopexit: ; preds = %bb69
- ret i8* null
+ ret ptr null
}
diff --git a/llvm/test/Transforms/NewGVN/2009-11-12-MemDepMallocBitCast.ll b/llvm/test/Transforms/NewGVN/2009-11-12-MemDepMallocBitCast.ll
index 2ccd1688df5b..3eda7ca1b812 100644
--- a/llvm/test/Transforms/NewGVN/2009-11-12-MemDepMallocBitCast.ll
+++ b/llvm/test/Transforms/NewGVN/2009-11-12-MemDepMallocBitCast.ll
@@ -3,13 +3,12 @@
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
define i64 @test() {
- %1 = tail call i8* @malloc(i64 mul (i64 4, i64 ptrtoint (i64* getelementptr (i64, i64* null, i64 1) to i64))) ; <i8*> [#uses=2]
- store i8 42, i8* %1
- %X = bitcast i8* %1 to i64* ; <i64*> [#uses=1]
- %Y = load i64, i64* %X ; <i64> [#uses=1]
+ %1 = tail call ptr @malloc(i64 mul (i64 4, i64 ptrtoint (ptr getelementptr (i64, ptr null, i64 1) to i64))) ; <ptr> [#uses=2]
+ store i8 42, ptr %1
+ %Y = load i64, ptr %1 ; <i64> [#uses=1]
ret i64 %Y
-; CHECK: %Y = load i64, i64* %X
+; CHECK: %Y = load i64, ptr %1
; CHECK: ret i64 %Y
}
-declare noalias i8* @malloc(i64)
+declare noalias ptr @malloc(i64)
diff --git a/llvm/test/Transforms/NewGVN/2010-03-31-RedundantPHIs.ll b/llvm/test/Transforms/NewGVN/2010-03-31-RedundantPHIs.ll
index 7664b9e4530e..321f3cff89a1 100644
--- a/llvm/test/Transforms/NewGVN/2010-03-31-RedundantPHIs.ll
+++ b/llvm/test/Transforms/NewGVN/2010-03-31-RedundantPHIs.ll
@@ -3,7 +3,7 @@
; CHECK-NOT: load
; CHECK-NOT: phi
-define i8* @cat(i8* %s1, ...) nounwind {
+define ptr @cat(ptr %s1, ...) nounwind {
entry:
br i1 undef, label %bb, label %bb3
@@ -11,7 +11,7 @@ bb: ; preds = %entry
unreachable
bb3: ; preds = %entry
- store i8* undef, i8** undef, align 4
+ store ptr undef, ptr undef, align 4
br i1 undef, label %bb5, label %bb6
bb5: ; preds = %bb3
@@ -24,8 +24,8 @@ bb8: ; preds = %bb12
br i1 undef, label %bb9, label %bb10
bb9: ; preds = %bb8
- %0 = load i8*, i8** undef, align 4 ; <i8*> [#uses=0]
- %1 = load i8*, i8** undef, align 4 ; <i8*> [#uses=0]
+ %0 = load ptr, ptr undef, align 4 ; <ptr> [#uses=0]
+ %1 = load ptr, ptr undef, align 4 ; <ptr> [#uses=0]
br label %bb11
bb10: ; preds = %bb8
@@ -38,5 +38,5 @@ bb12: ; preds = %bb11, %bb6
br i1 undef, label %bb8, label %bb13
bb13: ; preds = %bb12
- ret i8* undef
+ ret ptr undef
}
diff --git a/llvm/test/Transforms/NewGVN/2010-05-08-OneBit.ll b/llvm/test/Transforms/NewGVN/2010-05-08-OneBit.ll
index b36368579412..0d2d45a5e0d9 100644
--- a/llvm/test/Transforms/NewGVN/2010-05-08-OneBit.ll
+++ b/llvm/test/Transforms/NewGVN/2010-05-08-OneBit.ll
@@ -4,11 +4,10 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-unknown-linux-gnu"
-define i32 @main(i32 %argc, i8** nocapture %argv) personality i32 (...)* @__gxx_personality_v0 {
+define i32 @main(i32 %argc, ptr nocapture %argv) personality ptr @__gxx_personality_v0 {
entry:
- %0 = getelementptr inbounds i8, i8* undef, i64 5 ; <i8*> [#uses=1]
- %1 = bitcast i8* %0 to i32* ; <i32*> [#uses=1]
- store i32 undef, i32* %1, align 1
+ %0 = getelementptr inbounds i8, ptr undef, i64 5 ; <ptr> [#uses=1]
+ store i32 undef, ptr %0, align 1
br i1 undef, label %k121.i.i, label %l117.i.i
l117.i.i: ; preds = %entry
@@ -29,10 +28,9 @@ l129.i.i: ; preds = %k121.i.i
unreachable
k133.i.i: ; preds = %k121.i.i
- %2 = getelementptr i8, i8* undef, i64 5 ; <i8*> [#uses=1]
- %3 = bitcast i8* %2 to i1* ; <i1*> [#uses=1]
- %4 = load i1, i1* %3 ; <i1> [#uses=1]
- br i1 %4, label %k151.i.i, label %l147.i.i
+ %1 = getelementptr i8, ptr undef, i64 5 ; <ptr> [#uses=1]
+ %2 = load i1, ptr %1 ; <i1> [#uses=1]
+ br i1 %2, label %k151.i.i, label %l147.i.i
l147.i.i: ; preds = %k133.i.i
invoke fastcc void @foo()
@@ -45,7 +43,7 @@ k151.i.i: ; preds = %k133.i.i
ret i32 0
landing_pad: ; preds = %l147.i.i, %l129.i.i, %l117.i.i
- %exn = landingpad {i8*, i32}
+ %exn = landingpad {ptr, i32}
cleanup
switch i32 undef, label %fin [
i32 1, label %catch1
diff --git a/llvm/test/Transforms/NewGVN/2011-04-27-phioperands.ll b/llvm/test/Transforms/NewGVN/2011-04-27-phioperands.ll
index 57a7bd02b562..3e8a5d84405e 100644
--- a/llvm/test/Transforms/NewGVN/2011-04-27-phioperands.ll
+++ b/llvm/test/Transforms/NewGVN/2011-04-27-phioperands.ll
@@ -27,7 +27,7 @@ doemit.exit76.i:
br label %"<bb 53>.i"
"<L98>.i":
- store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @nuls, i64 0, i64 0), i8** undef, align 8
+ store ptr @nuls, ptr undef, align 8
br label %"<bb 53>.i"
"<L99>.i":
@@ -50,7 +50,7 @@ doemit.exit76.i:
"<bb 53>.i":
%wascaret_2.i = phi i32 [ 0, %"<L39>.i" ], [ 0, %"<L29>.i" ], [ 0, %"<L28>.i" ], [ 0, %"<bb 35>.i" ], [ 0, %"<L99>.i" ], [ 0, %"<L98>.i" ], [ 0, %doemit.exit76.i ], [ 1, %doemit.exit51.i ], [ 0, %"<L24>.i" ]
- %D.5496_84.i = load i8*, i8** undef, align 8
+ %D.5496_84.i = load ptr, ptr undef, align 8
br i1 undef, label %"<bb 54>.i", label %"<bb 5>"
"<bb 54>.i":
diff --git a/llvm/test/Transforms/NewGVN/2011-09-07-TypeIdFor.ll b/llvm/test/Transforms/NewGVN/2011-09-07-TypeIdFor.ll
index 771449a5bb15..46e3c2830920 100644
--- a/llvm/test/Transforms/NewGVN/2011-09-07-TypeIdFor.ll
+++ b/llvm/test/Transforms/NewGVN/2011-09-07-TypeIdFor.ll
@@ -1,6 +1,6 @@
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
%struct.__fundamental_type_info_pseudo = type { %struct.__type_info_pseudo }
-%struct.__type_info_pseudo = type { i8*, i8* }
+%struct.__type_info_pseudo = type { ptr, ptr }
@_ZTIi = external constant %struct.__fundamental_type_info_pseudo
@_ZTIb = external constant %struct.__fundamental_type_info_pseudo
@@ -9,70 +9,70 @@ declare void @_Z4barv()
declare void @_Z7cleanupv()
-declare i32 @llvm.eh.typeid.for(i8*) nounwind readonly
+declare i32 @llvm.eh.typeid.for(ptr) nounwind readonly
-declare i8* @__cxa_begin_catch(i8*) nounwind
+declare ptr @__cxa_begin_catch(ptr) nounwind
declare void @__cxa_end_catch()
-declare i32 @__gxx_personality_v0(i32, i64, i8*, i8*)
+declare i32 @__gxx_personality_v0(i32, i64, ptr, ptr)
-define void @_Z3foov() uwtable personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 {
+define void @_Z3foov() uwtable personality ptr @__gxx_personality_v0 {
entry:
invoke void @_Z4barv()
to label %return unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 }
- catch %struct.__fundamental_type_info_pseudo* @_ZTIi
- catch %struct.__fundamental_type_info_pseudo* @_ZTIb
- catch %struct.__fundamental_type_info_pseudo* @_ZTIi
- catch %struct.__fundamental_type_info_pseudo* @_ZTIb
- %exc_ptr2.i = extractvalue { i8*, i32 } %0, 0
- %filter3.i = extractvalue { i8*, i32 } %0, 1
- %typeid.i = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%struct.__fundamental_type_info_pseudo* @_ZTIi to i8*))
+ %0 = landingpad { ptr, i32 }
+ catch ptr @_ZTIi
+ catch ptr @_ZTIb
+ catch ptr @_ZTIi
+ catch ptr @_ZTIb
+ %exc_ptr2.i = extractvalue { ptr, i32 } %0, 0
+ %filter3.i = extractvalue { ptr, i32 } %0, 1
+ %typeid.i = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIi)
; CHECK: call i32 @llvm.eh.typeid.for
%1 = icmp eq i32 %filter3.i, %typeid.i
br i1 %1, label %ppad, label %next
next: ; preds = %lpad
- %typeid1.i = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%struct.__fundamental_type_info_pseudo* @_ZTIb to i8*))
+ %typeid1.i = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIb)
; CHECK: call i32 @llvm.eh.typeid.for
%2 = icmp eq i32 %filter3.i, %typeid1.i
br i1 %2, label %ppad2, label %next2
ppad: ; preds = %lpad
- %3 = tail call i8* @__cxa_begin_catch(i8* %exc_ptr2.i) nounwind
+ %3 = tail call ptr @__cxa_begin_catch(ptr %exc_ptr2.i) nounwind
tail call void @__cxa_end_catch() nounwind
br label %return
ppad2: ; preds = %next
- %D.2073_5.i = tail call i8* @__cxa_begin_catch(i8* %exc_ptr2.i) nounwind
+ %D.2073_5.i = tail call ptr @__cxa_begin_catch(ptr %exc_ptr2.i) nounwind
tail call void @__cxa_end_catch() nounwind
br label %return
next2: ; preds = %next
call void @_Z7cleanupv()
- %typeid = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%struct.__fundamental_type_info_pseudo* @_ZTIi to i8*))
+ %typeid = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIi)
; CHECK-NOT: call i32 @llvm.eh.typeid.for
%4 = icmp eq i32 %filter3.i, %typeid
br i1 %4, label %ppad3, label %next3
next3: ; preds = %next2
- %typeid1 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%struct.__fundamental_type_info_pseudo* @_ZTIb to i8*))
+ %typeid1 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIb)
%5 = icmp eq i32 %filter3.i, %typeid1
br i1 %5, label %ppad4, label %unwind
unwind: ; preds = %next3
- resume { i8*, i32 } %0
+ resume { ptr, i32 } %0
ppad3: ; preds = %next2
- %6 = tail call i8* @__cxa_begin_catch(i8* %exc_ptr2.i) nounwind
+ %6 = tail call ptr @__cxa_begin_catch(ptr %exc_ptr2.i) nounwind
tail call void @__cxa_end_catch() nounwind
br label %return
ppad4: ; preds = %next3
- %D.2080_5 = tail call i8* @__cxa_begin_catch(i8* %exc_ptr2.i) nounwind
+ %D.2080_5 = tail call ptr @__cxa_begin_catch(ptr %exc_ptr2.i) nounwind
tail call void @__cxa_end_catch() nounwind
br label %return
diff --git a/llvm/test/Transforms/NewGVN/2016-08-30-MaskedScatterGather-xfail-inseltpoison.ll b/llvm/test/Transforms/NewGVN/2016-08-30-MaskedScatterGather-xfail-inseltpoison.ll
index 229031239f49..2fb275d7aaf4 100644
--- a/llvm/test/Transforms/NewGVN/2016-08-30-MaskedScatterGather-xfail-inseltpoison.ll
+++ b/llvm/test/Transforms/NewGVN/2016-08-30-MaskedScatterGather-xfail-inseltpoison.ll
@@ -1,8 +1,8 @@
; XFAIL: *
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
-declare void @llvm.masked.scatter.v2i32.v2p0i32(<2 x i32> , <2 x i32*> , i32 , <2 x i1> )
-declare <2 x i32> @llvm.masked.gather.v2i32.v2p0i32(<2 x i32*>, i32, <2 x i1>, <2 x i32>)
+declare void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> , <2 x ptr> , i32 , <2 x i1> )
+declare <2 x i32> @llvm.masked.gather.v2i32.v2p0(<2 x ptr>, i32, <2 x i1>, <2 x i32>)
; This test ensures that masked scatter and gather operations, which take vectors of pointers,
; do not have pointer aliasing ignored when being processed.
@@ -13,31 +13,31 @@ declare <2 x i32> @llvm.masked.gather.v2i32.v2p0i32(<2 x i32*>, i32, <2 x i1>, <
; CHECK: llvm.masked.gather
; CHECK: llvm.masked.scatter
; CHECK: llvm.masked.gather
-define spir_kernel void @test(<2 x i32*> %in1, <2 x i32*> %in2, i32* %out) {
+define spir_kernel void @test(<2 x ptr> %in1, <2 x ptr> %in2, ptr %out) {
entry:
; Just some temporary storage
%tmp.0 = alloca i32
%tmp.1 = alloca i32
- %tmp.i = insertelement <2 x i32*> poison, i32* %tmp.0, i32 0
- %tmp = insertelement <2 x i32*> %tmp.i, i32* %tmp.1, i32 1
+ %tmp.i = insertelement <2 x ptr> poison, ptr %tmp.0, i32 0
+ %tmp = insertelement <2 x ptr> %tmp.i, ptr %tmp.1, i32 1
; Read from in1 and in2
- %in1.v = call <2 x i32> @llvm.masked.gather.v2i32.v2p0i32(<2 x i32*> %in1, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
- %in2.v = call <2 x i32> @llvm.masked.gather.v2i32.v2p0i32(<2 x i32*> %in2, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
+ %in1.v = call <2 x i32> @llvm.masked.gather.v2i32.v2p0(<2 x ptr> %in1, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
+ %in2.v = call <2 x i32> @llvm.masked.gather.v2i32.v2p0(<2 x ptr> %in2, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
; Store in1 to the allocas
- call void @llvm.masked.scatter.v2i32.v2p0i32(<2 x i32> %in1.v, <2 x i32*> %tmp, i32 1, <2 x i1> <i1 true, i1 true>);
+ call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> %in1.v, <2 x ptr> %tmp, i32 1, <2 x i1> <i1 true, i1 true>);
; Read in1 from the allocas
; This gather should alias the scatter we just saw
- %tmp.v.0 = call <2 x i32> @llvm.masked.gather.v2i32.v2p0i32(<2 x i32*> %tmp, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
+ %tmp.v.0 = call <2 x i32> @llvm.masked.gather.v2i32.v2p0(<2 x ptr> %tmp, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
; Store in2 to the allocas
- call void @llvm.masked.scatter.v2i32.v2p0i32(<2 x i32> %in2.v, <2 x i32*> %tmp, i32 1, <2 x i1> <i1 true, i1 true>);
+ call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> %in2.v, <2 x ptr> %tmp, i32 1, <2 x i1> <i1 true, i1 true>);
; Read in2 from the allocas
; This gather should alias the scatter we just saw, and not be eliminated
- %tmp.v.1 = call <2 x i32> @llvm.masked.gather.v2i32.v2p0i32(<2 x i32*> %tmp, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
+ %tmp.v.1 = call <2 x i32> @llvm.masked.gather.v2i32.v2p0(<2 x ptr> %tmp, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
; Store in2 to out for good measure
%tmp.v.1.0 = extractelement <2 x i32> %tmp.v.1, i32 0
%tmp.v.1.1 = extractelement <2 x i32> %tmp.v.1, i32 1
- store i32 %tmp.v.1.0, i32* %out
- %out.1 = getelementptr i32, i32* %out, i32 1
- store i32 %tmp.v.1.1, i32* %out.1
+ store i32 %tmp.v.1.0, ptr %out
+ %out.1 = getelementptr i32, ptr %out, i32 1
+ store i32 %tmp.v.1.1, ptr %out.1
ret void
}
diff --git a/llvm/test/Transforms/NewGVN/2016-08-30-MaskedScatterGather-xfail.ll b/llvm/test/Transforms/NewGVN/2016-08-30-MaskedScatterGather-xfail.ll
index 1818d7f0045c..47db666132db 100644
--- a/llvm/test/Transforms/NewGVN/2016-08-30-MaskedScatterGather-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/2016-08-30-MaskedScatterGather-xfail.ll
@@ -1,8 +1,8 @@
; XFAIL: *
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
-declare void @llvm.masked.scatter.v2i32.v2p0i32(<2 x i32> , <2 x i32*> , i32 , <2 x i1> )
-declare <2 x i32> @llvm.masked.gather.v2i32.v2p0i32(<2 x i32*>, i32, <2 x i1>, <2 x i32>)
+declare void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> , <2 x ptr> , i32 , <2 x i1> )
+declare <2 x i32> @llvm.masked.gather.v2i32.v2p0(<2 x ptr>, i32, <2 x i1>, <2 x i32>)
; This test ensures that masked scatter and gather operations, which take vectors of pointers,
; do not have pointer aliasing ignored when being processed.
@@ -13,31 +13,31 @@ declare <2 x i32> @llvm.masked.gather.v2i32.v2p0i32(<2 x i32*>, i32, <2 x i1>, <
; CHECK: llvm.masked.gather
; CHECK: llvm.masked.scatter
; CHECK: llvm.masked.gather
-define spir_kernel void @test(<2 x i32*> %in1, <2 x i32*> %in2, i32* %out) {
+define spir_kernel void @test(<2 x ptr> %in1, <2 x ptr> %in2, ptr %out) {
entry:
; Just some temporary storage
%tmp.0 = alloca i32
%tmp.1 = alloca i32
- %tmp.i = insertelement <2 x i32*> undef, i32* %tmp.0, i32 0
- %tmp = insertelement <2 x i32*> %tmp.i, i32* %tmp.1, i32 1
+ %tmp.i = insertelement <2 x ptr> undef, ptr %tmp.0, i32 0
+ %tmp = insertelement <2 x ptr> %tmp.i, ptr %tmp.1, i32 1
; Read from in1 and in2
- %in1.v = call <2 x i32> @llvm.masked.gather.v2i32.v2p0i32(<2 x i32*> %in1, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
- %in2.v = call <2 x i32> @llvm.masked.gather.v2i32.v2p0i32(<2 x i32*> %in2, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
+ %in1.v = call <2 x i32> @llvm.masked.gather.v2i32.v2p0(<2 x ptr> %in1, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
+ %in2.v = call <2 x i32> @llvm.masked.gather.v2i32.v2p0(<2 x ptr> %in2, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
; Store in1 to the allocas
- call void @llvm.masked.scatter.v2i32.v2p0i32(<2 x i32> %in1.v, <2 x i32*> %tmp, i32 1, <2 x i1> <i1 true, i1 true>);
+ call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> %in1.v, <2 x ptr> %tmp, i32 1, <2 x i1> <i1 true, i1 true>);
; Read in1 from the allocas
; This gather should alias the scatter we just saw
- %tmp.v.0 = call <2 x i32> @llvm.masked.gather.v2i32.v2p0i32(<2 x i32*> %tmp, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
+ %tmp.v.0 = call <2 x i32> @llvm.masked.gather.v2i32.v2p0(<2 x ptr> %tmp, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
; Store in2 to the allocas
- call void @llvm.masked.scatter.v2i32.v2p0i32(<2 x i32> %in2.v, <2 x i32*> %tmp, i32 1, <2 x i1> <i1 true, i1 true>);
+ call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> %in2.v, <2 x ptr> %tmp, i32 1, <2 x i1> <i1 true, i1 true>);
; Read in2 from the allocas
; This gather should alias the scatter we just saw, and not be eliminated
- %tmp.v.1 = call <2 x i32> @llvm.masked.gather.v2i32.v2p0i32(<2 x i32*> %tmp, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
+ %tmp.v.1 = call <2 x i32> @llvm.masked.gather.v2i32.v2p0(<2 x ptr> %tmp, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i32> undef) #1
; Store in2 to out for good measure
%tmp.v.1.0 = extractelement <2 x i32> %tmp.v.1, i32 0
%tmp.v.1.1 = extractelement <2 x i32> %tmp.v.1, i32 1
- store i32 %tmp.v.1.0, i32* %out
- %out.1 = getelementptr i32, i32* %out, i32 1
- store i32 %tmp.v.1.1, i32* %out.1
+ store i32 %tmp.v.1.0, ptr %out
+ %out.1 = getelementptr i32, ptr %out, i32 1
+ store i32 %tmp.v.1.1, ptr %out.1
ret void
}
diff --git a/llvm/test/Transforms/NewGVN/MemdepMiscompile.ll b/llvm/test/Transforms/NewGVN/MemdepMiscompile.ll
index 8dbd82ada68c..f2d1827d87b0 100644
--- a/llvm/test/Transforms/NewGVN/MemdepMiscompile.ll
+++ b/llvm/test/Transforms/NewGVN/MemdepMiscompile.ll
@@ -13,14 +13,14 @@ entry:
; CHECK: call void @RunInMode
; CHECK: br i1 %tobool, label %while.cond.backedge, label %if.then
; CHECK: while.cond.backedge:
-; CHECK: load i32, i32* %shouldExit
+; CHECK: load i32, ptr %shouldExit
; CHECK: br i1 %cmp, label %while.body
%shouldExit = alloca i32, align 4
%tasksIdle = alloca i32, align 4
- store i32 0, i32* %shouldExit, align 4
- store i32 0, i32* %tasksIdle, align 4
- call void @CTestInitialize(i32* %tasksIdle) nounwind
- %0 = load i32, i32* %shouldExit, align 4
+ store i32 0, ptr %shouldExit, align 4
+ store i32 0, ptr %tasksIdle, align 4
+ call void @CTestInitialize(ptr %tasksIdle) nounwind
+ %0 = load i32, ptr %shouldExit, align 4
%cmp1 = icmp eq i32 %0, 0
br i1 %cmp1, label %while.body.lr.ph, label %while.end
@@ -29,17 +29,17 @@ while.body.lr.ph:
while.body:
call void @RunInMode(i32 100) nounwind
- %1 = load i32, i32* %tasksIdle, align 4
+ %1 = load i32, ptr %tasksIdle, align 4
%tobool = icmp eq i32 %1, 0
br i1 %tobool, label %while.cond.backedge, label %if.then
if.then:
- store i32 0, i32* %tasksIdle, align 4
- call void @TimerCreate(i32* %shouldExit) nounwind
+ store i32 0, ptr %tasksIdle, align 4
+ call void @TimerCreate(ptr %shouldExit) nounwind
br label %while.cond.backedge
while.cond.backedge:
- %2 = load i32, i32* %shouldExit, align 4
+ %2 = load i32, ptr %shouldExit, align 4
%cmp = icmp eq i32 %2, 0
br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge
@@ -49,6 +49,6 @@ while.cond.while.end_crit_edge:
while.end:
ret i32 0
}
-declare void @CTestInitialize(i32*)
+declare void @CTestInitialize(ptr)
declare void @RunInMode(i32)
-declare void @TimerCreate(i32*)
+declare void @TimerCreate(ptr)
diff --git a/llvm/test/Transforms/NewGVN/addrspacecast.ll b/llvm/test/Transforms/NewGVN/addrspacecast.ll
index 6b96c841b3af..fea8a2f3f858 100644
--- a/llvm/test/Transforms/NewGVN/addrspacecast.ll
+++ b/llvm/test/Transforms/NewGVN/addrspacecast.ll
@@ -1,108 +1,108 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=newgvn < %s | FileCheck %s
-define i32 addrspace(1)* @addrspacecast(i32* %ptr) {
+define ptr addrspace(1) @addrspacecast(ptr %ptr) {
; CHECK-LABEL: @addrspacecast(
; CHECK-NEXT: block1:
-; CHECK-NEXT: [[Z1:%.*]] = addrspacecast i32* [[PTR:%.*]] to i32 addrspace(1)*
+; CHECK-NEXT: [[Z1:%.*]] = addrspacecast ptr [[PTR:%.*]] to ptr addrspace(1)
; CHECK-NEXT: br label [[BLOCK2:%.*]]
; CHECK: block2:
-; CHECK-NEXT: store i32 addrspace(1)* [[Z1]], i32 addrspace(1)** undef
-; CHECK-NEXT: ret i32 addrspace(1)* [[Z1]]
+; CHECK-NEXT: store ptr addrspace(1) [[Z1]], ptr undef
+; CHECK-NEXT: ret ptr addrspace(1) [[Z1]]
;
block1:
- %z1 = addrspacecast i32* %ptr to i32 addrspace(1)*
+ %z1 = addrspacecast ptr %ptr to ptr addrspace(1)
br label %block2
block2:
- %z2 = addrspacecast i32* %ptr to i32 addrspace(1)*
- store i32 addrspace(1)* %z1, i32 addrspace(1)** undef
- ret i32 addrspace(1)* %z2
+ %z2 = addrspacecast ptr %ptr to ptr addrspace(1)
+ store ptr addrspace(1) %z1, ptr undef
+ ret ptr addrspace(1) %z2
}
; Make sure casts with the same source value but
diff erent result
; address spaces aren't incorrectly merged.
-define i32 addrspace(1)* @addrspacecast_
diff erent_result_types(i32* %ptr) {
+define ptr addrspace(1) @addrspacecast_
diff erent_result_types(ptr %ptr) {
; CHECK-LABEL: @addrspacecast_
diff erent_result_types(
; CHECK-NEXT: block1:
-; CHECK-NEXT: [[Z1:%.*]] = addrspacecast i32* [[PTR:%.*]] to i32 addrspace(2)*
+; CHECK-NEXT: [[Z1:%.*]] = addrspacecast ptr [[PTR:%.*]] to ptr addrspace(2)
; CHECK-NEXT: br label [[BLOCK2:%.*]]
; CHECK: block2:
-; CHECK-NEXT: [[Z2:%.*]] = addrspacecast i32* [[PTR]] to i32 addrspace(1)*
-; CHECK-NEXT: store i32 addrspace(2)* [[Z1]], i32 addrspace(2)** undef
-; CHECK-NEXT: ret i32 addrspace(1)* [[Z2]]
+; CHECK-NEXT: [[Z2:%.*]] = addrspacecast ptr [[PTR]] to ptr addrspace(1)
+; CHECK-NEXT: store ptr addrspace(2) [[Z1]], ptr undef
+; CHECK-NEXT: ret ptr addrspace(1) [[Z2]]
;
block1:
- %z1 = addrspacecast i32* %ptr to i32 addrspace(2)*
+ %z1 = addrspacecast ptr %ptr to ptr addrspace(2)
br label %block2
block2:
- %z2 = addrspacecast i32* %ptr to i32 addrspace(1)*
- store i32 addrspace(2)* %z1, i32 addrspace(2)** undef
- ret i32 addrspace(1)* %z2
+ %z2 = addrspacecast ptr %ptr to ptr addrspace(1)
+ store ptr addrspace(2) %z1, ptr undef
+ ret ptr addrspace(1) %z2
}
-define i32 addrspace(1)* @addrspacecast_simplify(i32 addrspace(1)* %ptr) {
+define ptr addrspace(1) @addrspacecast_simplify(ptr addrspace(1) %ptr) {
; CHECK-LABEL: @addrspacecast_simplify(
; CHECK-NEXT: block1:
-; CHECK-NEXT: [[CAST0:%.*]] = addrspacecast i32 addrspace(1)* [[PTR:%.*]] to i32*
+; CHECK-NEXT: [[CAST0:%.*]] = addrspacecast ptr addrspace(1) [[PTR:%.*]] to ptr
; CHECK-NEXT: br label [[BLOCK2:%.*]]
; CHECK: block2:
-; CHECK-NEXT: store i32 addrspace(1)* [[PTR]], i32 addrspace(1)** undef
-; CHECK-NEXT: ret i32 addrspace(1)* [[PTR]]
+; CHECK-NEXT: store ptr addrspace(1) [[PTR]], ptr undef
+; CHECK-NEXT: ret ptr addrspace(1) [[PTR]]
;
block1:
- %cast0 = addrspacecast i32 addrspace(1)* %ptr to i32*
- %z1 = addrspacecast i32* %cast0 to i32 addrspace(1)*
+ %cast0 = addrspacecast ptr addrspace(1) %ptr to ptr
+ %z1 = addrspacecast ptr %cast0 to ptr addrspace(1)
br label %block2
block2:
- %z2 = addrspacecast i32* %cast0 to i32 addrspace(1)*
- store i32 addrspace(1)* %z1, i32 addrspace(1)** undef
- ret i32 addrspace(1)* %z2
+ %z2 = addrspacecast ptr %cast0 to ptr addrspace(1)
+ store ptr addrspace(1) %z1, ptr undef
+ ret ptr addrspace(1) %z2
}
- at h = common local_unnamed_addr global i32* null, align 4
+ at h = common local_unnamed_addr global ptr null, align 4
-define i32 addrspace(1)* @addrspacecast_constant() {
+define ptr addrspace(1) @addrspacecast_constant() {
; CHECK-LABEL: @addrspacecast_constant(
; CHECK-NEXT: block1:
-; CHECK-NEXT: store i32* undef, i32** @h, align 4
+; CHECK-NEXT: store ptr undef, ptr @h, align 4
; CHECK-NEXT: br label [[BLOCK2:%.*]]
; CHECK: block2:
-; CHECK-NEXT: store i32 addrspace(1)* undef, i32 addrspace(1)** undef
-; CHECK-NEXT: ret i32 addrspace(1)* undef
+; CHECK-NEXT: store ptr addrspace(1) undef, ptr undef
+; CHECK-NEXT: ret ptr addrspace(1) undef
;
block1:
- store i32* undef, i32** @h, align 4
- %ptr = load i32*, i32** @h, align 4
- %z1 = addrspacecast i32* %ptr to i32 addrspace(1)*
+ store ptr undef, ptr @h, align 4
+ %ptr = load ptr, ptr @h, align 4
+ %z1 = addrspacecast ptr %ptr to ptr addrspace(1)
br label %block2
block2:
- %z2 = addrspacecast i32* %ptr to i32 addrspace(1)*
- store i32 addrspace(1)* %z1, i32 addrspace(1)** undef
- ret i32 addrspace(1)* %z2
+ %z2 = addrspacecast ptr %ptr to ptr addrspace(1)
+ store ptr addrspace(1) %z1, ptr undef
+ ret ptr addrspace(1) %z2
}
-define i32 addrspace(1)* @addrspacecast_leader(i32** %arg.ptr) {
+define ptr addrspace(1) @addrspacecast_leader(ptr %arg.ptr) {
; CHECK-LABEL: @addrspacecast_leader(
; CHECK-NEXT: block1:
-; CHECK-NEXT: [[LOAD0:%.*]] = load i32*, i32** [[ARG_PTR:%.*]]
-; CHECK-NEXT: [[Z1:%.*]] = addrspacecast i32* [[LOAD0]] to i32 addrspace(1)*
+; CHECK-NEXT: [[LOAD0:%.*]] = load ptr, ptr [[ARG_PTR:%.*]]
+; CHECK-NEXT: [[Z1:%.*]] = addrspacecast ptr [[LOAD0]] to ptr addrspace(1)
; CHECK-NEXT: br label [[BLOCK2:%.*]]
; CHECK: block2:
-; CHECK-NEXT: store i32 addrspace(1)* [[Z1]], i32 addrspace(1)** undef
-; CHECK-NEXT: ret i32 addrspace(1)* [[Z1]]
+; CHECK-NEXT: store ptr addrspace(1) [[Z1]], ptr undef
+; CHECK-NEXT: ret ptr addrspace(1) [[Z1]]
;
block1:
- %load0 = load i32*, i32** %arg.ptr
- %z1 = addrspacecast i32* %load0 to i32 addrspace(1)*
+ %load0 = load ptr, ptr %arg.ptr
+ %z1 = addrspacecast ptr %load0 to ptr addrspace(1)
br label %block2
block2:
- %load1 = load i32*, i32** %arg.ptr
- %z2 = addrspacecast i32* %load1 to i32 addrspace(1)*
- store i32 addrspace(1)* %z1, i32 addrspace(1)** undef
- ret i32 addrspace(1)* %z2
+ %load1 = load ptr, ptr %arg.ptr
+ %z2 = addrspacecast ptr %load1 to ptr addrspace(1)
+ store ptr addrspace(1) %z1, ptr undef
+ ret ptr addrspace(1) %z2
}
diff --git a/llvm/test/Transforms/NewGVN/assume-equal-xfail.ll b/llvm/test/Transforms/NewGVN/assume-equal-xfail.ll
index a156ac4e788f..972a9bc0ae3a 100644
--- a/llvm/test/Transforms/NewGVN/assume-equal-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/assume-equal-xfail.ll
@@ -1,9 +1,9 @@
; XFAIL: *
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
-%struct.A = type { i32 (...)** }
- at _ZTV1A = available_externally unnamed_addr constant [4 x i8*] [i8* null, i8* bitcast (i8** @_ZTI1A to i8*), i8* bitcast (i32 (%struct.A*)* @_ZN1A3fooEv to i8*), i8* bitcast (i32 (%struct.A*)* @_ZN1A3barEv to i8*)], align 8
- at _ZTI1A = external constant i8*
+%struct.A = type { ptr }
+ at _ZTV1A = available_externally unnamed_addr constant [4 x ptr] [ptr null, ptr @_ZTI1A, ptr @_ZN1A3fooEv, ptr @_ZN1A3barEv], align 8
+ at _ZTI1A = external constant ptr
; Checks if indirect calls can be replaced with direct
; assuming that %vtable == @_ZTV1A (with alignment).
@@ -12,32 +12,28 @@
define void @_Z1gb(i1 zeroext %p) {
entry:
- %call = tail call noalias i8* @_Znwm(i64 8) #4
- %0 = bitcast i8* %call to %struct.A*
- tail call void @_ZN1AC1Ev(%struct.A* %0) #1
- %1 = bitcast i8* %call to i8***
- %vtable = load i8**, i8*** %1, align 8
- %cmp.vtables = icmp eq i8** %vtable, getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV1A, i64 0, i64 2)
+ %call = tail call noalias ptr @_Znwm(i64 8) #4
+ tail call void @_ZN1AC1Ev(ptr %call) #1
+ %vtable = load ptr, ptr %call, align 8
+ %cmp.vtables = icmp eq ptr %vtable, getelementptr inbounds ([4 x ptr], ptr @_ZTV1A, i64 0, i64 2)
tail call void @llvm.assume(i1 %cmp.vtables)
br i1 %p, label %if.then, label %if.else
if.then: ; preds = %entry
- %vtable1.cast = bitcast i8** %vtable to i32 (%struct.A*)**
- %2 = load i32 (%struct.A*)*, i32 (%struct.A*)** %vtable1.cast, align 8
+ %0 = load ptr, ptr %vtable, align 8
; CHECK: call i32 @_ZN1A3fooEv(
- %call2 = tail call i32 %2(%struct.A* %0) #1
+ %call2 = tail call i32 %0(ptr %call) #1
br label %if.end
if.else: ; preds = %entry
- %vfn47 = getelementptr inbounds i8*, i8** %vtable, i64 1
- %vfn4 = bitcast i8** %vfn47 to i32 (%struct.A*)**
+ %vfn47 = getelementptr inbounds ptr, ptr %vtable, i64 1
; CHECK: call i32 @_ZN1A3barEv(
- %3 = load i32 (%struct.A*)*, i32 (%struct.A*)** %vfn4, align 8
+ %1 = load ptr, ptr %vfn47, align 8
- %call5 = tail call i32 %3(%struct.A* %0) #1
+ %call5 = tail call i32 %1(ptr %call) #1
br label %if.end
if.end: ; preds = %if.else, %if.then
@@ -48,50 +44,42 @@ if.end: ; preds = %if.else, %if.then
; CHECK-LABEL: define void @invariantGroupHandling(i1 zeroext %p) {
define void @invariantGroupHandling(i1 zeroext %p) {
entry:
- %call = tail call noalias i8* @_Znwm(i64 8) #4
- %0 = bitcast i8* %call to %struct.A*
- tail call void @_ZN1AC1Ev(%struct.A* %0) #1
- %1 = bitcast i8* %call to i8***
- %vtable = load i8**, i8*** %1, align 8, !invariant.group !0
- %cmp.vtables = icmp eq i8** %vtable, getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV1A, i64 0, i64 2)
+ %call = tail call noalias ptr @_Znwm(i64 8) #4
+ tail call void @_ZN1AC1Ev(ptr %call) #1
+ %vtable = load ptr, ptr %call, align 8, !invariant.group !0
+ %cmp.vtables = icmp eq ptr %vtable, getelementptr inbounds ([4 x ptr], ptr @_ZTV1A, i64 0, i64 2)
tail call void @llvm.assume(i1 %cmp.vtables)
br i1 %p, label %if.then, label %if.else
if.then: ; preds = %entry
- %vtable1.cast = bitcast i8** %vtable to i32 (%struct.A*)**
- %2 = load i32 (%struct.A*)*, i32 (%struct.A*)** %vtable1.cast, align 8
+ %0 = load ptr, ptr %vtable, align 8
; CHECK: call i32 @_ZN1A3fooEv(
- %call2 = tail call i32 %2(%struct.A* %0) #1
- %vtable1 = load i8**, i8*** %1, align 8, !invariant.group !0
- %vtable2.cast = bitcast i8** %vtable1 to i32 (%struct.A*)**
- %call1 = load i32 (%struct.A*)*, i32 (%struct.A*)** %vtable2.cast, align 8
+ %call2 = tail call i32 %0(ptr %call) #1
+ %vtable1 = load ptr, ptr %call, align 8, !invariant.group !0
+ %call1 = load ptr, ptr %vtable1, align 8
; CHECK: call i32 @_ZN1A3fooEv(
- %callx = tail call i32 %call1(%struct.A* %0) #1
+ %callx = tail call i32 %call1(ptr %call) #1
- %vtable2 = load i8**, i8*** %1, align 8, !invariant.group !0
- %vtable3.cast = bitcast i8** %vtable2 to i32 (%struct.A*)**
- %call4 = load i32 (%struct.A*)*, i32 (%struct.A*)** %vtable3.cast, align 8
+ %vtable2 = load ptr, ptr %call, align 8, !invariant.group !0
+ %call4 = load ptr, ptr %vtable2, align 8
; CHECK: call i32 @_ZN1A3fooEv(
- %cally = tail call i32 %call4(%struct.A* %0) #1
+ %cally = tail call i32 %call4(ptr %call) #1
- %b = bitcast i8* %call to %struct.A**
- %vtable3 = load %struct.A*, %struct.A** %b, align 8, !invariant.group !0
- %vtable4.cast = bitcast %struct.A* %vtable3 to i32 (%struct.A*)**
- %vfun = load i32 (%struct.A*)*, i32 (%struct.A*)** %vtable4.cast, align 8
+ %vtable3 = load ptr, ptr %call, align 8, !invariant.group !0
+ %vfun = load ptr, ptr %vtable3, align 8
; CHECK: call i32 @_ZN1A3fooEv(
- %unknown = tail call i32 %vfun(%struct.A* %0) #1
+ %unknown = tail call i32 %vfun(ptr %call) #1
br label %if.end
if.else: ; preds = %entry
- %vfn47 = getelementptr inbounds i8*, i8** %vtable, i64 1
- %vfn4 = bitcast i8** %vfn47 to i32 (%struct.A*)**
+ %vfn47 = getelementptr inbounds ptr, ptr %vtable, i64 1
; CHECK: call i32 @_ZN1A3barEv(
- %3 = load i32 (%struct.A*)*, i32 (%struct.A*)** %vfn4, align 8
+ %1 = load ptr, ptr %vfn47, align 8
- %call5 = tail call i32 %3(%struct.A* %0) #1
+ %call5 = tail call i32 %1(ptr %call) #1
br label %if.end
if.end: ; preds = %if.else, %if.then
@@ -104,19 +92,16 @@ if.end: ; preds = %if.else, %if.then
define i32 @main() {
entry:
- %call = tail call noalias i8* @_Znwm(i64 8)
- %0 = bitcast i8* %call to %struct.A*
- tail call void @_ZN1AC1Ev(%struct.A* %0)
- %1 = bitcast i8* %call to i8***
- %vtable = load i8**, i8*** %1, align 8
- %cmp.vtables = icmp eq i8** %vtable, getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV1A, i64 0, i64 2)
+ %call = tail call noalias ptr @_Znwm(i64 8)
+ tail call void @_ZN1AC1Ev(ptr %call)
+ %vtable = load ptr, ptr %call, align 8
+ %cmp.vtables = icmp eq ptr %vtable, getelementptr inbounds ([4 x ptr], ptr @_ZTV1A, i64 0, i64 2)
tail call void @llvm.assume(i1 %cmp.vtables)
- %vtable1.cast = bitcast i8** %vtable to i32 (%struct.A*)**
; CHECK: call i32 @_ZN1A3fooEv(
- %2 = load i32 (%struct.A*)*, i32 (%struct.A*)** %vtable1.cast, align 8
+ %0 = load ptr, ptr %vtable, align 8
- %call2 = tail call i32 %2(%struct.A* %0)
+ %call2 = tail call i32 %0(ptr %call)
ret i32 0
}
@@ -127,11 +112,11 @@ define float @_Z1gf(float %p) {
entry:
%p.addr = alloca float, align 4
%f = alloca float, align 4
- store float %p, float* %p.addr, align 4
+ store float %p, ptr %p.addr, align 4
- store float 3.000000e+00, float* %f, align 4
- %0 = load float, float* %p.addr, align 4
- %1 = load float, float* %f, align 4
+ store float 3.000000e+00, ptr %f, align 4
+ %0 = load float, ptr %p.addr, align 4
+ %1 = load float, ptr %f, align 4
%cmp = fcmp oeq float %1, %0 ; note const on lhs
call void @llvm.assume(i1 %cmp)
@@ -144,9 +129,9 @@ entry:
define float @_Z1hf(float %p) {
entry:
%p.addr = alloca float, align 4
- store float %p, float* %p.addr, align 4
+ store float %p, ptr %p.addr, align 4
- %0 = load float, float* %p.addr, align 4
+ %0 = load float, ptr %p.addr, align 4
%cmp = fcmp nnan ueq float %0, 3.000000e+00
call void @llvm.assume(i1 %cmp)
@@ -154,10 +139,10 @@ entry:
ret float %0
}
-declare noalias i8* @_Znwm(i64)
-declare void @_ZN1AC1Ev(%struct.A*)
+declare noalias ptr @_Znwm(i64)
+declare void @_ZN1AC1Ev(ptr)
declare void @llvm.assume(i1)
-declare i32 @_ZN1A3fooEv(%struct.A*)
-declare i32 @_ZN1A3barEv(%struct.A*)
+declare i32 @_ZN1A3fooEv(ptr)
+declare i32 @_ZN1A3barEv(ptr)
!0 = !{!"struct A"}
diff --git a/llvm/test/Transforms/NewGVN/assume-equal.ll b/llvm/test/Transforms/NewGVN/assume-equal.ll
index 123f73572043..7d590d3e7506 100644
--- a/llvm/test/Transforms/NewGVN/assume-equal.ll
+++ b/llvm/test/Transforms/NewGVN/assume-equal.ll
@@ -5,16 +5,16 @@ define float @_Z1if(float %p) {
; CHECK-LABEL: @_Z1if(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[P_ADDR:%.*]] = alloca float, align 4
-; CHECK-NEXT: store float [[P:%.*]], float* [[P_ADDR]], align 4
+; CHECK-NEXT: store float [[P:%.*]], ptr [[P_ADDR]], align 4
; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[P]], 3.000000e+00
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: ret float [[P]]
;
entry:
%p.addr = alloca float, align 4
- store float %p, float* %p.addr, align 4
+ store float %p, ptr %p.addr, align 4
- %0 = load float, float* %p.addr, align 4
+ %0 = load float, ptr %p.addr, align 4
%cmp = fcmp ueq float %0, 3.000000e+00 ; no nnan flag - can't propagate
call void @llvm.assume(i1 %cmp)
@@ -31,7 +31,7 @@ define i32 @_Z1ii(i32 %p) {
; CHECK: bb2:
; CHECK-NEXT: br i1 true, label [[BB2]], label [[BB2]]
; CHECK: 0:
-; CHECK-NEXT: store i8 poison, i8* null, align 1
+; CHECK-NEXT: store i8 poison, ptr null, align 1
; CHECK-NEXT: ret i32 [[P]]
;
entry:
@@ -82,7 +82,7 @@ define i32 @_Z1ik(i32 %p) {
; CHECK-NEXT: call void @llvm.assume(i1 false)
; CHECK-NEXT: ret i32 15
; CHECK: bb3:
-; CHECK-NEXT: store i8 poison, i8* null, align 1
+; CHECK-NEXT: store i8 poison, ptr null, align 1
; CHECK-NEXT: ret i32 17
;
entry:
diff --git a/llvm/test/Transforms/NewGVN/basic-cyclic-opt.ll b/llvm/test/Transforms/NewGVN/basic-cyclic-opt.ll
index 00b004df7812..baef8b51fbc1 100644
--- a/llvm/test/Transforms/NewGVN/basic-cyclic-opt.ll
+++ b/llvm/test/Transforms/NewGVN/basic-cyclic-opt.ll
@@ -4,13 +4,13 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
;; Function Attrs: nounwind ssp uwtable
;; We should eliminate the sub, and one of the phi nodes
-define void @vnum_test1(i32* %data) #0 {
+define void @vnum_test1(ptr %data) #0 {
; CHECK-LABEL: @vnum_test1(
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[TMP:%.*]] = getelementptr inbounds i32, i32* [[DATA:%.*]], i64 3
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[DATA]], i64 4
-; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
+; CHECK-NEXT: [[TMP:%.*]] = getelementptr inbounds i32, ptr [[DATA:%.*]], i64 3
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, ptr [[DATA]], i64 4
+; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
; CHECK-NEXT: br label [[BB4:%.*]]
; CHECK: bb4:
; CHECK-NEXT: [[M_0:%.*]] = phi i32 [ [[TMP3]], [[BB:%.*]] ], [ [[TMP15:%.*]], [[BB17:%.*]] ]
@@ -18,14 +18,14 @@ define void @vnum_test1(i32* %data) #0 {
; CHECK-NEXT: [[TMP5:%.*]] = icmp slt i32 [[I_0]], [[TMP1]]
; CHECK-NEXT: br i1 [[TMP5]], label [[BB6:%.*]], label [[BB19:%.*]]
; CHECK: bb6:
-; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i32, i32* [[DATA]], i64 2
-; CHECK-NEXT: [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
+; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i32, ptr [[DATA]], i64 2
+; CHECK-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
; CHECK-NEXT: [[TMP9:%.*]] = sext i32 [[TMP8]] to i64
-; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i32, i32* [[DATA]], i64 [[TMP9]]
-; CHECK-NEXT: store i32 2, i32* [[TMP10]], align 4
-; CHECK-NEXT: store i32 0, i32* [[DATA]], align 4
-; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i32, i32* [[DATA]], i64 1
-; CHECK-NEXT: [[TMP14:%.*]] = load i32, i32* [[TMP13]], align 4
+; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i32, ptr [[DATA]], i64 [[TMP9]]
+; CHECK-NEXT: store i32 2, ptr [[TMP10]], align 4
+; CHECK-NEXT: store i32 0, ptr [[DATA]], align 4
+; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i32, ptr [[DATA]], i64 1
+; CHECK-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP13]], align 4
; CHECK-NEXT: [[TMP15]] = add nsw i32 [[M_0]], [[TMP14]]
; CHECK-NEXT: br label [[BB17]]
; CHECK: bb17:
@@ -35,10 +35,10 @@ define void @vnum_test1(i32* %data) #0 {
; CHECK-NEXT: ret void
;
bb:
- %tmp = getelementptr inbounds i32, i32* %data, i64 3
- %tmp1 = load i32, i32* %tmp, align 4
- %tmp2 = getelementptr inbounds i32, i32* %data, i64 4
- %tmp3 = load i32, i32* %tmp2, align 4
+ %tmp = getelementptr inbounds i32, ptr %data, i64 3
+ %tmp1 = load i32, ptr %tmp, align 4
+ %tmp2 = getelementptr inbounds i32, ptr %data, i64 4
+ %tmp3 = load i32, ptr %tmp2, align 4
br label %bb4
bb4: ; preds = %bb17, %bb
@@ -49,16 +49,15 @@ bb4: ; preds = %bb17, %bb
br i1 %tmp5, label %bb6, label %bb19
bb6: ; preds = %bb4
- %tmp7 = getelementptr inbounds i32, i32* %data, i64 2
- %tmp8 = load i32, i32* %tmp7, align 4
+ %tmp7 = getelementptr inbounds i32, ptr %data, i64 2
+ %tmp8 = load i32, ptr %tmp7, align 4
%tmp9 = sext i32 %tmp8 to i64
- %tmp10 = getelementptr inbounds i32, i32* %data, i64 %tmp9
- store i32 2, i32* %tmp10, align 4
+ %tmp10 = getelementptr inbounds i32, ptr %data, i64 %tmp9
+ store i32 2, ptr %tmp10, align 4
%tmp11 = sub nsw i32 %m.0, %n.0
- %tmp12 = getelementptr inbounds i32, i32* %data, i64 0
- store i32 %tmp11, i32* %tmp12, align 4
- %tmp13 = getelementptr inbounds i32, i32* %data, i64 1
- %tmp14 = load i32, i32* %tmp13, align 4
+ store i32 %tmp11, ptr %data, align 4
+ %tmp13 = getelementptr inbounds i32, ptr %data, i64 1
+ %tmp14 = load i32, ptr %tmp13, align 4
%tmp15 = add nsw i32 %m.0, %tmp14
%tmp16 = add nsw i32 %n.0, %tmp14
br label %bb17
@@ -75,13 +74,13 @@ bb19: ; preds = %bb4
;; We should eliminate the sub, one of the phi nodes, prove the store of the sub
;; and the load of data are equivalent, that the load always produces constant 0, and
;; delete the load replacing it with constant 0.
-define i32 @vnum_test2(i32* %data) #0 {
+define i32 @vnum_test2(ptr %data) #0 {
; CHECK-LABEL: @vnum_test2(
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[TMP:%.*]] = getelementptr inbounds i32, i32* [[DATA:%.*]], i64 3
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[DATA]], i64 4
-; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
+; CHECK-NEXT: [[TMP:%.*]] = getelementptr inbounds i32, ptr [[DATA:%.*]], i64 3
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, ptr [[DATA]], i64 4
+; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
; CHECK-NEXT: br label [[BB4:%.*]]
; CHECK: bb4:
; CHECK-NEXT: [[M_0:%.*]] = phi i32 [ [[TMP3]], [[BB:%.*]] ], [ [[TMP15:%.*]], [[BB19:%.*]] ]
@@ -89,14 +88,14 @@ define i32 @vnum_test2(i32* %data) #0 {
; CHECK-NEXT: [[TMP5:%.*]] = icmp slt i32 [[I_0]], [[TMP1]]
; CHECK-NEXT: br i1 [[TMP5]], label [[BB6:%.*]], label [[BB21:%.*]]
; CHECK: bb6:
-; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i32, i32* [[DATA]], i64 2
-; CHECK-NEXT: [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
+; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i32, ptr [[DATA]], i64 2
+; CHECK-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
; CHECK-NEXT: [[TMP9:%.*]] = sext i32 [[TMP8]] to i64
-; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i32, i32* [[DATA]], i64 [[TMP9]]
-; CHECK-NEXT: store i32 2, i32* [[TMP10]], align 4
-; CHECK-NEXT: store i32 0, i32* [[DATA]], align 4
-; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i32, i32* [[DATA]], i64 1
-; CHECK-NEXT: [[TMP14:%.*]] = load i32, i32* [[TMP13]], align 4
+; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i32, ptr [[DATA]], i64 [[TMP9]]
+; CHECK-NEXT: store i32 2, ptr [[TMP10]], align 4
+; CHECK-NEXT: store i32 0, ptr [[DATA]], align 4
+; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i32, ptr [[DATA]], i64 1
+; CHECK-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP13]], align 4
; CHECK-NEXT: [[TMP15]] = add nsw i32 [[M_0]], [[TMP14]]
; CHECK-NEXT: br label [[BB19]]
; CHECK: bb19:
@@ -106,10 +105,10 @@ define i32 @vnum_test2(i32* %data) #0 {
; CHECK-NEXT: ret i32 0
;
bb:
- %tmp = getelementptr inbounds i32, i32* %data, i64 3
- %tmp1 = load i32, i32* %tmp, align 4
- %tmp2 = getelementptr inbounds i32, i32* %data, i64 4
- %tmp3 = load i32, i32* %tmp2, align 4
+ %tmp = getelementptr inbounds i32, ptr %data, i64 3
+ %tmp1 = load i32, ptr %tmp, align 4
+ %tmp2 = getelementptr inbounds i32, ptr %data, i64 4
+ %tmp3 = load i32, ptr %tmp2, align 4
br label %bb4
bb4: ; preds = %bb19, %bb
@@ -121,20 +120,18 @@ bb4: ; preds = %bb19, %bb
br i1 %tmp5, label %bb6, label %bb21
bb6: ; preds = %bb4
- %tmp7 = getelementptr inbounds i32, i32* %data, i64 2
- %tmp8 = load i32, i32* %tmp7, align 4
+ %tmp7 = getelementptr inbounds i32, ptr %data, i64 2
+ %tmp8 = load i32, ptr %tmp7, align 4
%tmp9 = sext i32 %tmp8 to i64
- %tmp10 = getelementptr inbounds i32, i32* %data, i64 %tmp9
- store i32 2, i32* %tmp10, align 4
+ %tmp10 = getelementptr inbounds i32, ptr %data, i64 %tmp9
+ store i32 2, ptr %tmp10, align 4
%tmp11 = sub nsw i32 %m.0, %n.0
- %tmp12 = getelementptr inbounds i32, i32* %data, i64 0
- store i32 %tmp11, i32* %tmp12, align 4
- %tmp13 = getelementptr inbounds i32, i32* %data, i64 1
- %tmp14 = load i32, i32* %tmp13, align 4
+ store i32 %tmp11, ptr %data, align 4
+ %tmp13 = getelementptr inbounds i32, ptr %data, i64 1
+ %tmp14 = load i32, ptr %tmp13, align 4
%tmp15 = add nsw i32 %m.0, %tmp14
%tmp16 = add nsw i32 %n.0, %tmp14
- %tmp17 = getelementptr inbounds i32, i32* %data, i64 0
- %tmp18 = load i32, i32* %tmp17, align 4
+ %tmp18 = load i32, ptr %data, align 4
br label %bb19
bb19: ; preds = %bb6
@@ -149,13 +146,13 @@ bb21: ; preds = %bb4
; Function Attrs: nounwind ssp uwtable
;; Same as test 2, with a conditional store of m-n, so it has to also discover
;; that data ends up with the same value no matter what branch is taken.
-define i32 @vnum_test3(i32* %data) #0 {
+define i32 @vnum_test3(ptr %data) #0 {
; CHECK-LABEL: @vnum_test3(
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[TMP:%.*]] = getelementptr inbounds i32, i32* [[DATA:%.*]], i64 3
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[TMP]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[DATA]], i64 4
-; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
+; CHECK-NEXT: [[TMP:%.*]] = getelementptr inbounds i32, ptr [[DATA:%.*]], i64 3
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP]], align 4
+; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, ptr [[DATA]], i64 4
+; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
; CHECK-NEXT: br label [[BB4:%.*]]
; CHECK: bb4:
; CHECK-NEXT: [[N_0:%.*]] = phi i32 [ [[TMP3]], [[BB:%.*]] ], [ [[TMP19:%.*]], [[BB21:%.*]] ]
@@ -163,16 +160,16 @@ define i32 @vnum_test3(i32* %data) #0 {
; CHECK-NEXT: [[TMP5:%.*]] = icmp slt i32 [[I_0]], [[TMP1]]
; CHECK-NEXT: br i1 [[TMP5]], label [[BB6:%.*]], label [[BB23:%.*]]
; CHECK: bb6:
-; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i32, i32* [[DATA]], i64 2
-; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, i32* [[DATA]], i64 5
-; CHECK-NEXT: store i32 0, i32* [[TMP9]], align 4
+; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i32, ptr [[DATA]], i64 2
+; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, ptr [[DATA]], i64 5
+; CHECK-NEXT: store i32 0, ptr [[TMP9]], align 4
; CHECK-NEXT: [[TMP10:%.*]] = icmp slt i32 [[I_0]], 30
; CHECK-NEXT: br i1 [[TMP10]], label [[BB11:%.*]], label [[BB14:%.*]]
; CHECK: bb11:
; CHECK-NEXT: br label [[BB14]]
; CHECK: bb14:
-; CHECK-NEXT: [[TMP17:%.*]] = getelementptr inbounds i32, i32* [[DATA]], i64 1
-; CHECK-NEXT: [[TMP18:%.*]] = load i32, i32* [[TMP17]], align 4
+; CHECK-NEXT: [[TMP17:%.*]] = getelementptr inbounds i32, ptr [[DATA]], i64 1
+; CHECK-NEXT: [[TMP18:%.*]] = load i32, ptr [[TMP17]], align 4
; CHECK-NEXT: [[TMP19]] = add nsw i32 [[N_0]], [[TMP18]]
; CHECK-NEXT: br label [[BB21]]
; CHECK: bb21:
@@ -182,10 +179,10 @@ define i32 @vnum_test3(i32* %data) #0 {
; CHECK-NEXT: ret i32 0
;
bb:
- %tmp = getelementptr inbounds i32, i32* %data, i64 3
- %tmp1 = load i32, i32* %tmp, align 4
- %tmp2 = getelementptr inbounds i32, i32* %data, i64 4
- %tmp3 = load i32, i32* %tmp2, align 4
+ %tmp = getelementptr inbounds i32, ptr %data, i64 3
+ %tmp1 = load i32, ptr %tmp, align 4
+ %tmp2 = getelementptr inbounds i32, ptr %data, i64 4
+ %tmp3 = load i32, ptr %tmp2, align 4
br label %bb4
bb4: ; preds = %bb21, %bb
@@ -197,24 +194,24 @@ bb4: ; preds = %bb21, %bb
br i1 %tmp5, label %bb6, label %bb23
bb6: ; preds = %bb4
- %tmp7 = getelementptr inbounds i32, i32* %data, i64 2
- %tmp8 = load i32, i32* %tmp7, align 4
- %tmp9 = getelementptr inbounds i32, i32* %data, i64 5
- store i32 0, i32* %tmp9, align 4
+ %tmp7 = getelementptr inbounds i32, ptr %data, i64 2
+ %tmp8 = load i32, ptr %tmp7, align 4
+ %tmp9 = getelementptr inbounds i32, ptr %data, i64 5
+ store i32 0, ptr %tmp9, align 4
%tmp10 = icmp slt i32 %i.0, 30
br i1 %tmp10, label %bb11, label %bb14
bb11: ; preds = %bb6
%tmp12 = sub nsw i32 %m.0, %n.0
- %tmp13 = getelementptr inbounds i32, i32* %data, i64 5
- store i32 %tmp12, i32* %tmp13, align 4
+ %tmp13 = getelementptr inbounds i32, ptr %data, i64 5
+ store i32 %tmp12, ptr %tmp13, align 4
br label %bb14
bb14: ; preds = %bb11, %bb6
- %tmp15 = getelementptr inbounds i32, i32* %data, i64 5
- %tmp16 = load i32, i32* %tmp15, align 4
- %tmp17 = getelementptr inbounds i32, i32* %data, i64 1
- %tmp18 = load i32, i32* %tmp17, align 4
+ %tmp15 = getelementptr inbounds i32, ptr %data, i64 5
+ %tmp16 = load i32, ptr %tmp15, align 4
+ %tmp17 = getelementptr inbounds i32, ptr %data, i64 1
+ %tmp18 = load i32, ptr %tmp17, align 4
%tmp19 = add nsw i32 %m.0, %tmp18
%tmp20 = add nsw i32 %n.0, %tmp18
br label %bb21
@@ -245,10 +242,10 @@ bb23: ; preds = %bb4
;; Both loads should equal 0, but it requires being
;; completely optimistic about MemoryPhis, otherwise
;; we will not be able to see through the cycle.
-define i8 @irreducible_memoryphi(i8* noalias %arg, i8* noalias %arg2) {
+define i8 @irreducible_memoryphi(ptr noalias %arg, ptr noalias %arg2) {
; CHECK-LABEL: @irreducible_memoryphi(
; CHECK-NEXT: bb:
-; CHECK-NEXT: store i8 0, i8* [[ARG:%.*]]
+; CHECK-NEXT: store i8 0, ptr [[ARG:%.*]]
; CHECK-NEXT: br i1 undef, label [[BB2:%.*]], label [[BB1:%.*]]
; CHECK: bb1:
; CHECK-NEXT: br label [[BB2]]
@@ -258,19 +255,19 @@ define i8 @irreducible_memoryphi(i8* noalias %arg, i8* noalias %arg2) {
; CHECK-NEXT: ret i8 0
;
bb:
- store i8 0, i8 *%arg
+ store i8 0, ptr %arg
br i1 undef, label %bb2, label %bb1
bb1: ; preds = %bb2, %bb
br label %bb2
bb2: ; preds = %bb1, %bb
- %tmp2 = load i8, i8* %arg
- store i8 0, i8 *%arg
+ %tmp2 = load i8, ptr %arg
+ store i8 0, ptr %arg
br i1 undef, label %bb1, label %bb3
bb3: ; preds = %bb2
- %tmp = load i8, i8* %arg
+ %tmp = load i8, ptr %arg
%tmp3 = add i8 %tmp, %tmp2
ret i8 %tmp3
}
diff --git a/llvm/test/Transforms/NewGVN/basic-undef-test.ll b/llvm/test/Transforms/NewGVN/basic-undef-test.ll
index d5b4a4093b54..5b731fc5f9fa 100644
--- a/llvm/test/Transforms/NewGVN/basic-undef-test.ll
+++ b/llvm/test/Transforms/NewGVN/basic-undef-test.ll
@@ -2,13 +2,13 @@
; ModuleID = 'test3.ll'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-define i32 @main(i32 *%foo) {
+define i32 @main(ptr %foo) {
entry:
-; CHECK: load i32, i32* %foo, align 4
- %0 = load i32, i32* %foo, align 4
- store i32 5, i32* undef, align 4
-; CHECK-NOT: load i32, i32* %foo, align 4
- %1 = load i32, i32* %foo, align 4
+; CHECK: load i32, ptr %foo, align 4
+ %0 = load i32, ptr %foo, align 4
+ store i32 5, ptr undef, align 4
+; CHECK-NOT: load i32, ptr %foo, align 4
+ %1 = load i32, ptr %foo, align 4
; CHECK: add i32 %0, %0
%2 = add i32 %0, %1
ret i32 %2
diff --git a/llvm/test/Transforms/NewGVN/big-endian.ll b/llvm/test/Transforms/NewGVN/big-endian.ll
index accdbfa98fbd..b70fa6b119d0 100644
--- a/llvm/test/Transforms/NewGVN/big-endian.ll
+++ b/llvm/test/Transforms/NewGVN/big-endian.ll
@@ -6,18 +6,16 @@ target triple = "powerpc64-unknown-linux-gnu"
;; Make sure we use correct bit shift based on storage size for
;; loads reusing a load value.
-define i64 @test1({ i1, i8 }* %predA, { i1, i8 }* %predB) {
+define i64 @test1(ptr %predA, ptr %predB) {
; CHECK-LABEL: @test1(
-; CHECK-NEXT: [[VALUELOADA_FCA_0_GEP:%.*]] = getelementptr inbounds { i1, i8 }, { i1, i8 }* [[PREDA:%.*]], i64 0, i32 0
-; CHECK-NEXT: [[VALUELOADA_FCA_0_LOAD:%.*]] = load i1, i1* [[VALUELOADA_FCA_0_GEP]], align 8
-; CHECK-NEXT: [[VALUELOADB_FCA_0_GEP:%.*]] = getelementptr inbounds { i1, i8 }, { i1, i8 }* [[PREDB:%.*]], i64 0, i32 0
-; CHECK-NEXT: [[VALUELOADB_FCA_0_LOAD:%.*]] = load i1, i1* [[VALUELOADB_FCA_0_GEP]], align 8
+; CHECK-NEXT: [[VALUELOADA_FCA_0_LOAD:%.*]] = load i1, ptr [[PREDA:%.*]], align 8
+; CHECK-NEXT: [[VALUELOADB_FCA_0_LOAD:%.*]] = load i1, ptr [[PREDB:%.*]], align 8
; CHECK-NEXT: [[ISTRUE:%.*]] = and i1 [[VALUELOADA_FCA_0_LOAD]], [[VALUELOADB_FCA_0_LOAD]]
-; CHECK-NEXT: [[VALUELOADA_FCA_1_GEP:%.*]] = getelementptr inbounds { i1, i8 }, { i1, i8 }* [[PREDA]], i64 0, i32 1
-; CHECK-NEXT: [[VALUELOADA_FCA_1_LOAD:%.*]] = load i8, i8* [[VALUELOADA_FCA_1_GEP]], align 1
+; CHECK-NEXT: [[VALUELOADA_FCA_1_GEP:%.*]] = getelementptr inbounds { i1, i8 }, ptr [[PREDA]], i64 0, i32 1
+; CHECK-NEXT: [[VALUELOADA_FCA_1_LOAD:%.*]] = load i8, ptr [[VALUELOADA_FCA_1_GEP]], align 1
; CHECK-NEXT: [[ISNOTNULLA:%.*]] = icmp ne i8 [[VALUELOADA_FCA_1_LOAD]], 0
-; CHECK-NEXT: [[VALUELOADB_FCA_1_GEP:%.*]] = getelementptr inbounds { i1, i8 }, { i1, i8 }* [[PREDB]], i64 0, i32 1
-; CHECK-NEXT: [[VALUELOADB_FCA_1_LOAD:%.*]] = load i8, i8* [[VALUELOADB_FCA_1_GEP]], align 1
+; CHECK-NEXT: [[VALUELOADB_FCA_1_GEP:%.*]] = getelementptr inbounds { i1, i8 }, ptr [[PREDB]], i64 0, i32 1
+; CHECK-NEXT: [[VALUELOADB_FCA_1_LOAD:%.*]] = load i8, ptr [[VALUELOADB_FCA_1_GEP]], align 1
; CHECK-NEXT: [[ISNOTNULLB:%.*]] = icmp ne i8 [[VALUELOADB_FCA_1_LOAD]], 0
; CHECK-NEXT: [[ISNOTNULL:%.*]] = and i1 [[ISNOTNULLA]], [[ISNOTNULLB]]
; CHECK-NEXT: [[ISTRUEANDNOTNULL:%.*]] = and i1 [[ISTRUE]], [[ISNOTNULL]]
@@ -25,16 +23,16 @@ define i64 @test1({ i1, i8 }* %predA, { i1, i8 }* %predB) {
; CHECK-NEXT: ret i64 [[RET]]
;
- %valueLoadA.fca.0.gep = getelementptr inbounds { i1, i8 }, { i1, i8 }* %predA, i64 0, i32 0
- %valueLoadA.fca.0.load = load i1, i1* %valueLoadA.fca.0.gep, align 8
- %valueLoadB.fca.0.gep = getelementptr inbounds { i1, i8 }, { i1, i8 }* %predB, i64 0, i32 0
- %valueLoadB.fca.0.load = load i1, i1* %valueLoadB.fca.0.gep, align 8
+ %valueLoadA.fca.0.gep = getelementptr inbounds { i1, i8 }, ptr %predA, i64 0, i32 0
+ %valueLoadA.fca.0.load = load i1, ptr %valueLoadA.fca.0.gep, align 8
+ %valueLoadB.fca.0.gep = getelementptr inbounds { i1, i8 }, ptr %predB, i64 0, i32 0
+ %valueLoadB.fca.0.load = load i1, ptr %valueLoadB.fca.0.gep, align 8
%isTrue = and i1 %valueLoadA.fca.0.load, %valueLoadB.fca.0.load
- %valueLoadA.fca.1.gep = getelementptr inbounds { i1, i8 }, { i1, i8 }* %predA, i64 0, i32 1
- %valueLoadA.fca.1.load = load i8, i8* %valueLoadA.fca.1.gep, align 1
+ %valueLoadA.fca.1.gep = getelementptr inbounds { i1, i8 }, ptr %predA, i64 0, i32 1
+ %valueLoadA.fca.1.load = load i8, ptr %valueLoadA.fca.1.gep, align 1
%isNotNullA = icmp ne i8 %valueLoadA.fca.1.load, 0
- %valueLoadB.fca.1.gep = getelementptr inbounds { i1, i8 }, { i1, i8 }* %predB, i64 0, i32 1
- %valueLoadB.fca.1.load = load i8, i8* %valueLoadB.fca.1.gep, align 1
+ %valueLoadB.fca.1.gep = getelementptr inbounds { i1, i8 }, ptr %predB, i64 0, i32 1
+ %valueLoadB.fca.1.load = load i8, ptr %valueLoadB.fca.1.gep, align 1
%isNotNullB = icmp ne i8 %valueLoadB.fca.1.load, 0
%isNotNull = and i1 %isNotNullA, %isNotNullB
%isTrueAndNotNull = and i1 %isTrue, %isNotNull
@@ -43,16 +41,14 @@ define i64 @test1({ i1, i8 }* %predA, { i1, i8 }* %predB) {
}
;; And likewise for loads reusing a store value.
-define i1 @test2(i8 %V, i8* %P) {
+define i1 @test2(i8 %V, ptr %P) {
; CHECK-LABEL: @test2(
-; CHECK-NEXT: store i8 [[V:%.*]], i8* [[P:%.*]], align 1
-; CHECK-NEXT: [[P2:%.*]] = bitcast i8* [[P]] to i1*
-; CHECK-NEXT: [[A:%.*]] = load i1, i1* [[P2]], align 1
+; CHECK-NEXT: store i8 [[V:%.*]], ptr [[P:%.*]], align 1
+; CHECK-NEXT: [[A:%.*]] = load i1, ptr [[P]], align 1
; CHECK-NEXT: ret i1 [[A]]
;
- store i8 %V, i8* %P
- %P2 = bitcast i8* %P to i1*
- %A = load i1, i1* %P2
+ store i8 %V, ptr %P
+ %A = load i1, ptr %P
ret i1 %A
}
diff --git a/llvm/test/Transforms/NewGVN/bitcast-of-call.ll b/llvm/test/Transforms/NewGVN/bitcast-of-call.ll
index 0997f3e978a0..25866be08bd3 100644
--- a/llvm/test/Transforms/NewGVN/bitcast-of-call.ll
+++ b/llvm/test/Transforms/NewGVN/bitcast-of-call.ll
@@ -2,19 +2,15 @@
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
; PR2213
-define i32* @f(i8* %x) {
+define ptr @f(ptr %x) {
; CHECK-LABEL: @f(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP:%.*]] = call i8* @m(i32 12)
-; CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP]] to i32*
-; CHECK-NEXT: ret i32* [[TMP1]]
+; CHECK-NEXT: [[TMP:%.*]] = call ptr @m(i32 12)
+; CHECK-NEXT: ret ptr [[TMP]]
;
entry:
- %tmp = call i8* @m( i32 12 ) ; <i8*> [#uses=2]
- %tmp1 = bitcast i8* %tmp to i32* ; <i32*> [#uses=0]
- %tmp3 = bitcast i32* %tmp1 to i8*
- %tmp2 = bitcast i8* %tmp3 to i32* ; <i32*> [#uses=0]
- ret i32* %tmp2
+ %tmp = call ptr @m( i32 12 ) ; <ptr> [#uses=2]
+ ret ptr %tmp
}
-declare i8* @m(i32)
+declare ptr @m(i32)
diff --git a/llvm/test/Transforms/NewGVN/calloc-load-removal.ll b/llvm/test/Transforms/NewGVN/calloc-load-removal.ll
index 025aa21c945b..a8a1e66d97d9 100644
--- a/llvm/test/Transforms/NewGVN/calloc-load-removal.ll
+++ b/llvm/test/Transforms/NewGVN/calloc-load-removal.ll
@@ -5,15 +5,14 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
; Function Attrs: nounwind uwtable
define i32 @test1() {
- %1 = tail call noalias i8* @calloc(i64 1, i64 4)
- %2 = bitcast i8* %1 to i32*
+ %1 = tail call noalias ptr @calloc(i64 1, i64 4)
; This load is trivially constant zero
- %3 = load i32, i32* %2, align 4
- ret i32 %3
+ %2 = load i32, ptr %1, align 4
+ ret i32 %2
; CHECK-LABEL: @test1(
-; CHECK-NOT: %3 = load i32, i32* %2, align 4
+; CHECK-NOT: %2 = load i32, ptr %1, align 4
; CHECK: ret i32 0
}
-declare noalias i8* @calloc(i64, i64) mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc"
+declare noalias ptr @calloc(i64, i64) mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc"
diff --git a/llvm/test/Transforms/NewGVN/calls-nonlocal-xfail.ll b/llvm/test/Transforms/NewGVN/calls-nonlocal-xfail.ll
index b064d15e0064..0a1b3517e380 100644
--- a/llvm/test/Transforms/NewGVN/calls-nonlocal-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/calls-nonlocal-xfail.ll
@@ -6,9 +6,9 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin9"
-define i32 @test(i32 %g, i8* %P) nounwind {
+define i32 @test(i32 %g, ptr %P) nounwind {
entry:
- %tmp2 = call i32 @strlen( i8* %P ) nounwind readonly ; <i32> [#uses=1]
+ %tmp2 = call i32 @strlen( ptr %P ) nounwind readonly ; <i32> [#uses=1]
%tmp3 = icmp eq i32 %tmp2, 100 ; <i1> [#uses=1]
%tmp34 = zext i1 %tmp3 to i8 ; <i8> [#uses=1]
%toBool = icmp ne i8 %tmp34, 0 ; <i1> [#uses=1]
@@ -19,7 +19,7 @@ bb: ; preds = %entry
bb6: ; preds = %entry
%tmp8 = add i32 %g, 42 ; <i32> [#uses=2]
- %tmp10 = call i32 @strlen( i8* %P ) nounwind readonly ; <i32> [#uses=1]
+ %tmp10 = call i32 @strlen( ptr %P ) nounwind readonly ; <i32> [#uses=1]
%tmp11 = icmp eq i32 %tmp10, 100 ; <i1> [#uses=1]
%tmp1112 = zext i1 %tmp11 to i8 ; <i8> [#uses=1]
%toBool13 = icmp ne i8 %tmp1112, 0 ; <i1> [#uses=1]
@@ -30,7 +30,7 @@ bb14: ; preds = %bb6
bb16: ; preds = %bb6
%tmp18 = mul i32 %tmp8, 2 ; <i32> [#uses=1]
- %tmp20 = call i32 @strlen( i8* %P ) nounwind readonly ; <i32> [#uses=1]
+ %tmp20 = call i32 @strlen( ptr %P ) nounwind readonly ; <i32> [#uses=1]
%tmp21 = icmp eq i32 %tmp20, 100 ; <i1> [#uses=1]
%tmp2122 = zext i1 %tmp21 to i8 ; <i8> [#uses=1]
%toBool23 = icmp ne i8 %tmp2122, 0 ; <i1> [#uses=1]
@@ -50,9 +50,9 @@ return: ; preds = %bb27
ret i32 %tmp.0
}
-; CHECK: define i32 @test(i32 %g, i8* %P) #0 {
+; CHECK: define i32 @test(i32 %g, ptr %P) #0 {
; CHECK: entry:
-; CHECK: %tmp2 = call i32 @strlen(i8* %P) #1
+; CHECK: %tmp2 = call i32 @strlen(ptr %P) #1
; CHECK: %tmp3 = icmp eq i32 %tmp2, 100
; CHECK: %tmp34 = zext i1 %tmp3 to i8
; CHECK: br i1 %tmp3, label %bb, label %bb6
@@ -75,4 +75,4 @@ return: ; preds = %bb27
; CHECK: ret i32 %tmp.0
; CHECK: }
-declare i32 @strlen(i8*) nounwind readonly
+declare i32 @strlen(ptr) nounwind readonly
diff --git a/llvm/test/Transforms/NewGVN/calls-readonly.ll b/llvm/test/Transforms/NewGVN/calls-readonly.ll
index 95798be21457..68d74c1aeda7 100644
--- a/llvm/test/Transforms/NewGVN/calls-readonly.ll
+++ b/llvm/test/Transforms/NewGVN/calls-readonly.ll
@@ -4,9 +4,9 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin7"
-define i8* @test(i8* %P, i8* %Q, i32 %x, i32 %y) nounwind readonly {
+define ptr @test(ptr %P, ptr %Q, i32 %x, i32 %y) nounwind readonly {
entry:
- %0 = tail call i32 @strlen(i8* %P) ; <i32> [#uses=2]
+ %0 = tail call i32 @strlen(ptr %P) ; <i32> [#uses=2]
%1 = icmp eq i32 %0, 0 ; <i1> [#uses=1]
br i1 %1, label %bb, label %bb1
@@ -16,17 +16,17 @@ bb: ; preds = %entry
bb1: ; preds = %bb, %entry
%x_addr.0 = phi i32 [ %2, %bb ], [ %x, %entry ] ; <i32> [#uses=1]
- %3 = tail call i8* @strchr(i8* %Q, i32 97) ; <i8*> [#uses=1]
- %4 = tail call i32 @strlen(i8* %P) ; <i32> [#uses=1]
+ %3 = tail call ptr @strchr(ptr %Q, i32 97) ; <ptr> [#uses=1]
+ %4 = tail call i32 @strlen(ptr %P) ; <i32> [#uses=1]
%5 = add i32 %x_addr.0, %0 ; <i32> [#uses=1]
%.sum = sub i32 %5, %4 ; <i32> [#uses=1]
- %6 = getelementptr i8, i8* %3, i32 %.sum ; <i8*> [#uses=1]
- ret i8* %6
+ %6 = getelementptr i8, ptr %3, i32 %.sum ; <ptr> [#uses=1]
+ ret ptr %6
}
-; CHECK: define i8* @test(i8* %P, i8* %Q, i32 %x, i32 %y) #0 {
+; CHECK: define ptr @test(ptr %P, ptr %Q, i32 %x, i32 %y) #0 {
; CHECK: entry:
-; CHECK-NEXT: %0 = tail call i32 @strlen(i8* %P)
+; CHECK-NEXT: %0 = tail call i32 @strlen(ptr %P)
; CHECK-NEXT: %1 = icmp eq i32 %0, 0
; CHECK-NEXT: br i1 %1, label %bb, label %bb1
; CHECK: bb:
@@ -34,12 +34,12 @@ bb1: ; preds = %bb, %entry
; CHECK-NEXT: br label %bb1
; CHECK: bb1:
; CHECK-NEXT: %x_addr.0 = phi i32 [ %2, %bb ], [ %x, %entry ]
-; CHECK-NEXT: %3 = tail call i8* @strchr(i8* %Q, i32 97)
+; CHECK-NEXT: %3 = tail call ptr @strchr(ptr %Q, i32 97)
; CHECK-NEXT: %4 = add i32 %x_addr.0, %0
-; CHECK-NEXT: %5 = getelementptr i8, i8* %3, i32 %x_addr.0
-; CHECK-NEXT: ret i8* %5
+; CHECK-NEXT: %5 = getelementptr i8, ptr %3, i32 %x_addr.0
+; CHECK-NEXT: ret ptr %5
; CHECK: }
-declare i32 @strlen(i8*) nounwind readonly
+declare i32 @strlen(ptr) nounwind readonly
-declare i8* @strchr(i8*, i32) nounwind readonly
+declare ptr @strchr(ptr, i32) nounwind readonly
diff --git a/llvm/test/Transforms/NewGVN/completeness.ll b/llvm/test/Transforms/NewGVN/completeness.ll
index 73cfb6c49765..d968c785ceff 100644
--- a/llvm/test/Transforms/NewGVN/completeness.ll
+++ b/llvm/test/Transforms/NewGVN/completeness.ll
@@ -2,7 +2,7 @@
; RUN: opt < %s -passes=newgvn -enable-phi-of-ops=true -S | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-define i32 @test1(i32, i8**) {
+define i32 @test1(i32, ptr) {
; CHECK-LABEL: @test1(
; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP0:%.*]], 0
; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]]
@@ -27,7 +27,7 @@ define i32 @test1(i32, i8**) {
ret i32 %7
}
;; Dependent phi of ops
-define i32 @test1b(i32, i8**) {
+define i32 @test1b(i32, ptr) {
; CHECK-LABEL: @test1b(
; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP0:%.*]], 0
; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]]
@@ -152,38 +152,38 @@ final:
}
;; This example is a bit contrived because we can't create fake memoryuses, so we use two loads in the if blocks
-define i32 @test4(i32, i8**, i32* noalias, i32* noalias) {
+define i32 @test4(i32, ptr, ptr noalias, ptr noalias) {
; CHECK-LABEL: @test4(
-; CHECK-NEXT: store i32 5, i32* [[TMP2:%.*]], align 4
-; CHECK-NEXT: store i32 7, i32* [[TMP3:%.*]], align 4
+; CHECK-NEXT: store i32 5, ptr [[TMP2:%.*]], align 4
+; CHECK-NEXT: store i32 7, ptr [[TMP3:%.*]], align 4
; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i32 [[TMP0:%.*]], 0
; CHECK-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP7:%.*]]
; CHECK: br label [[TMP8:%.*]]
; CHECK: br label [[TMP8]]
; CHECK: [[DOT01:%.*]] = phi i32 [ 5, [[TMP6]] ], [ 7, [[TMP7]] ]
-; CHECK-NEXT: [[DOT0:%.*]] = phi i32* [ [[TMP2]], [[TMP6]] ], [ [[TMP3]], [[TMP7]] ]
-; CHECK-NEXT: [[TMP9:%.*]] = load i32, i32* [[DOT0]], align 4
+; CHECK-NEXT: [[DOT0:%.*]] = phi ptr [ [[TMP2]], [[TMP6]] ], [ [[TMP3]], [[TMP7]] ]
+; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOT0]], align 4
; CHECK-NEXT: [[TMP10:%.*]] = mul nsw i32 [[TMP9]], 15
; CHECK-NEXT: [[TMP11:%.*]] = mul nsw i32 [[TMP10]], [[DOT01]]
; CHECK-NEXT: ret i32 [[TMP11]]
;
- store i32 5, i32* %2, align 4
- store i32 7, i32* %3, align 4
+ store i32 5, ptr %2, align 4
+ store i32 7, ptr %3, align 4
%5 = icmp ne i32 %0, 0
br i1 %5, label %6, label %8
; <label>:6: ; preds = %4
- %7 = load i32, i32* %2, align 4
+ %7 = load i32, ptr %2, align 4
br label %10
; <label>:8: ; preds = %4
- %9 = load i32, i32* %3, align 4
+ %9 = load i32, ptr %3, align 4
br label %10
; <label>:10: ; preds = %8, %6
%.01 = phi i32 [ %7, %6 ], [ %9, %8 ]
- %.0 = phi i32* [ %2, %6 ], [ %3, %8 ]
- %11 = load i32, i32* %.0, align 4
+ %.0 = phi ptr [ %2, %6 ], [ %3, %8 ]
+ %11 = load i32, ptr %.0, align 4
%12 = mul nsw i32 %11, 15
%13 = mul nsw i32 %12, %.01
ret i32 %13
@@ -207,8 +207,8 @@ define i64 @test5(i64 %arg) {
; CHECK: bb7:
; CHECK-NEXT: [[TMP8:%.*]] = phi i64 [ [[ARG]], [[BB2]] ], [ [[TMP9]], [[BB5]] ]
; CHECK-NEXT: [[TMP9]] = add nsw i64 [[TMP8]], -1
-; CHECK-NEXT: [[TMP10:%.*]] = load i64, i64* getelementptr inbounds ([100 x i64], [100 x i64]* @global, i64 0, i64 0), align 16
-; CHECK-NEXT: [[TMP11:%.*]] = load i64, i64* getelementptr inbounds ([100 x i64], [100 x i64]* @global.1, i64 0, i64 0), align 16
+; CHECK-NEXT: [[TMP10:%.*]] = load i64, ptr @global, align 16
+; CHECK-NEXT: [[TMP11:%.*]] = load i64, ptr @global.1, align 16
; CHECK-NEXT: [[TMP12:%.*]] = mul nsw i64 [[TMP11]], [[TMP10]]
; CHECK-NEXT: [[TMP13:%.*]] = icmp eq i64 [[TMP12]], 0
; CHECK-NEXT: br i1 [[TMP13]], label [[BB5]], label [[BB14:%.*]]
@@ -219,12 +219,12 @@ define i64 @test5(i64 %arg) {
; CHECK-NEXT: [[TMP16:%.*]] = phi i64 [ [[TMP24:%.*]], [[BB15]] ], [ [[TMP11]], [[BB14]] ]
; CHECK-NEXT: [[TMP17:%.*]] = phi i64 [ [[TMP22:%.*]], [[BB15]] ], [ [[TMP10]], [[BB14]] ]
; CHECK-NEXT: [[TMP18:%.*]] = phi i64 [ [[TMP20:%.*]], [[BB15]] ], [ 0, [[BB14]] ]
-; CHECK-NEXT: store i64 [[PHIOFOPS]], i64* [[TMP]], align 8
+; CHECK-NEXT: store i64 [[PHIOFOPS]], ptr [[TMP]], align 8
; CHECK-NEXT: [[TMP20]] = add nuw nsw i64 [[TMP18]], 1
-; CHECK-NEXT: [[TMP21:%.*]] = getelementptr inbounds [100 x i64], [100 x i64]* @global, i64 0, i64 [[TMP20]]
-; CHECK-NEXT: [[TMP22]] = load i64, i64* [[TMP21]], align 8
-; CHECK-NEXT: [[TMP23:%.*]] = getelementptr inbounds [100 x i64], [100 x i64]* @global.1, i64 0, i64 [[TMP20]]
-; CHECK-NEXT: [[TMP24]] = load i64, i64* [[TMP23]], align 8
+; CHECK-NEXT: [[TMP21:%.*]] = getelementptr inbounds [100 x i64], ptr @global, i64 0, i64 [[TMP20]]
+; CHECK-NEXT: [[TMP22]] = load i64, ptr [[TMP21]], align 8
+; CHECK-NEXT: [[TMP23:%.*]] = getelementptr inbounds [100 x i64], ptr @global.1, i64 0, i64 [[TMP20]]
+; CHECK-NEXT: [[TMP24]] = load i64, ptr [[TMP23]], align 8
; CHECK-NEXT: [[TMP25]] = mul nsw i64 [[TMP24]], [[TMP22]]
; CHECK-NEXT: [[TMP26:%.*]] = icmp eq i64 [[TMP20]], [[TMP25]]
; CHECK-NEXT: br i1 [[TMP26]], label [[BB4:%.*]], label [[BB15]]
@@ -239,7 +239,6 @@ bb:
br i1 %tmp1, label %bb28, label %bb2
bb2: ; preds = %bb
- %tmp3 = bitcast i64* %tmp to i8*
br label %bb7
bb4: ; preds = %bb15
@@ -252,8 +251,8 @@ bb5: ; preds = %bb7, %bb4
bb7: ; preds = %bb5, %bb2
%tmp8 = phi i64 [ %arg, %bb2 ], [ %tmp9, %bb5 ]
%tmp9 = add nsw i64 %tmp8, -1
- %tmp10 = load i64, i64* getelementptr inbounds ([100 x i64], [100 x i64]* @global, i64 0, i64 0), align 16
- %tmp11 = load i64, i64* getelementptr inbounds ([100 x i64], [100 x i64]* @global.1, i64 0, i64 0), align 16
+ %tmp10 = load i64, ptr @global, align 16
+ %tmp11 = load i64, ptr @global.1, align 16
%tmp12 = mul nsw i64 %tmp11, %tmp10
%tmp13 = icmp eq i64 %tmp12, 0
br i1 %tmp13, label %bb5, label %bb14
@@ -267,12 +266,12 @@ bb15: ; preds = %bb15, %bb14
%tmp18 = phi i64 [ %tmp20, %bb15 ], [ 0, %bb14 ]
;; This multiply is an op of phis which is really equivalent to phi(tmp25, tmp12)
%tmp19 = mul nsw i64 %tmp16, %tmp17
- store i64 %tmp19, i64* %tmp, align 8
+ store i64 %tmp19, ptr %tmp, align 8
%tmp20 = add nuw nsw i64 %tmp18, 1
- %tmp21 = getelementptr inbounds [100 x i64], [100 x i64]* @global, i64 0, i64 %tmp20
- %tmp22 = load i64, i64* %tmp21, align 8
- %tmp23 = getelementptr inbounds [100 x i64], [100 x i64]* @global.1, i64 0, i64 %tmp20
- %tmp24 = load i64, i64* %tmp23, align 8
+ %tmp21 = getelementptr inbounds [100 x i64], ptr @global, i64 0, i64 %tmp20
+ %tmp22 = load i64, ptr %tmp21, align 8
+ %tmp23 = getelementptr inbounds [100 x i64], ptr @global.1, i64 0, i64 %tmp20
+ %tmp24 = load i64, ptr %tmp23, align 8
%tmp25 = mul nsw i64 %tmp24, %tmp22
%tmp26 = icmp eq i64 %tmp20, %tmp25
br i1 %tmp26, label %bb4, label %bb15
@@ -285,7 +284,7 @@ bb28: ; preds = %bb27, %bb
}
;; These icmps are all equivalent to phis of constants
-define i8 @test6(i8* %addr) {
+define i8 @test6(ptr %addr) {
; CHECK-LABEL: @test6(
; CHECK-NEXT: entry-block:
; CHECK-NEXT: br label %main-loop
@@ -293,10 +292,10 @@ define i8 @test6(i8* %addr) {
; CHECK-NEXT: [[PHIOFOPS1:%.*]] = phi i1 [ true, %entry-block ], [ false, [[CORE:%.*]] ]
; CHECK-NEXT: [[PHIOFOPS:%.*]] = phi i1 [ false, %entry-block ], [ true, [[CORE]] ]
; CHECK-NEXT: [[PHI:%.*]] = phi i8 [ 0, %entry-block ], [ 1, [[CORE]] ]
-; CHECK-NEXT: store volatile i8 0, i8* [[ADDR:%.*]]
+; CHECK-NEXT: store volatile i8 0, ptr [[ADDR:%.*]]
; CHECK-NEXT: br i1 [[PHIOFOPS1]], label %busy-wait-phi-0, label [[EXIT:%.*]]
; CHECK: busy-wait-phi-0:
-; CHECK-NEXT: [[LOAD:%.*]] = load volatile i8, i8* [[ADDR]]
+; CHECK-NEXT: [[LOAD:%.*]] = load volatile i8, ptr [[ADDR]]
; CHECK-NEXT: [[ICMP:%.*]] = icmp eq i8 [[LOAD]], 0
; CHECK-NEXT: br i1 [[ICMP]], label %busy-wait-phi-0, label [[CORE]]
; CHECK: core:
@@ -312,11 +311,11 @@ entry-block:
main-loop:
%phi = phi i8 [ 0, %entry-block ], [ 1, %core ]
%switch_0 = icmp eq i8 %phi, 0
- store volatile i8 0, i8* %addr
+ store volatile i8 0, ptr %addr
br i1 %switch_0, label %busy-wait-phi-0, label %exit
busy-wait-phi-0:
- %load = load volatile i8, i8* %addr
+ %load = load volatile i8, ptr %addr
%icmp = icmp eq i8 %load, 0
br i1 %icmp, label %busy-wait-phi-0, label %core
@@ -420,9 +419,9 @@ define void @test10() {
; CHECK-NEXT: b:
; CHECK-NEXT: br label [[G:%.*]]
; CHECK: g:
-; CHECK-NEXT: [[N:%.*]] = phi i32* [ [[H:%.*]], [[I:%.*]] ], [ null, [[B:%.*]] ]
-; CHECK-NEXT: [[H]] = getelementptr i32, i32* [[N]], i64 1
-; CHECK-NEXT: [[J:%.*]] = icmp eq i32* [[H]], inttoptr (i64 32 to i32*)
+; CHECK-NEXT: [[N:%.*]] = phi ptr [ [[H:%.*]], [[I:%.*]] ], [ null, [[B:%.*]] ]
+; CHECK-NEXT: [[H]] = getelementptr i32, ptr [[N]], i64 1
+; CHECK-NEXT: [[J:%.*]] = icmp eq ptr [[H]], inttoptr (i64 32 to ptr)
; CHECK-NEXT: br i1 [[J]], label [[C:%.*]], label [[I]]
; CHECK: i:
; CHECK-NEXT: br i1 undef, label [[K:%.*]], label [[G]]
@@ -434,27 +433,27 @@ define void @test10() {
; CHECK-NEXT: ret void
;
b:
- %m = getelementptr i32, i32* null, i64 8
+ %m = getelementptr i32, ptr null, i64 8
br label %g
g: ; preds = %i, %b
- %n = phi i32* [ %h, %i ], [ null, %b ]
- %h = getelementptr i32, i32* %n, i64 1
- %j = icmp eq i32* %h, %m
+ %n = phi ptr [ %h, %i ], [ null, %b ]
+ %h = getelementptr i32, ptr %n, i64 1
+ %j = icmp eq ptr %h, %m
br i1 %j, label %c, label %i
i: ; preds = %g
br i1 undef, label %k, label %g
k: ; preds = %i
- %l = icmp eq i32* %n, %m
+ %l = icmp eq ptr %n, %m
br i1 %l, label %c, label %o
o: ; preds = %k
br label %c
c: ; preds = %o, %k, %g
- %0 = phi i32* [ undef, %o ], [ %m, %k ], [ %m, %g ]
+ %0 = phi ptr [ undef, %o ], [ %m, %k ], [ %m, %g ]
ret void
}
@@ -467,8 +466,8 @@ define void @test11() {
; CHECK-NEXT: br label [[BB2]]
; CHECK: bb2:
; CHECK-NEXT: [[TMP:%.*]] = phi i1 [ false, [[BB1]] ], [ true, [[BB:%.*]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = call i32* @wombat()
-; CHECK-NEXT: [[TMP4:%.*]] = icmp ne i32* [[TMP3]], null
+; CHECK-NEXT: [[TMP3:%.*]] = call ptr @wombat()
+; CHECK-NEXT: [[TMP4:%.*]] = icmp ne ptr [[TMP3]], null
; CHECK-NEXT: [[TMP5:%.*]] = and i1 [[TMP]], [[TMP4]]
; CHECK-NEXT: br i1 [[TMP5]], label [[BB6:%.*]], label [[BB7:%.*]]
; CHECK: bb6:
@@ -484,8 +483,8 @@ bb1: ; preds = %bb
bb2: ; preds = %bb1, %bb
%tmp = phi i1 [ false, %bb1 ], [ true, %bb ]
- %tmp3 = call i32* @wombat()
- %tmp4 = icmp ne i32* %tmp3, null
+ %tmp3 = call ptr @wombat()
+ %tmp4 = icmp ne ptr %tmp3, null
%tmp5 = and i1 %tmp, %tmp4
br i1 %tmp5, label %bb6, label %bb7
@@ -496,7 +495,7 @@ bb7: ; preds = %bb2
ret void
}
-declare i32* @wombat()
+declare ptr @wombat()
;; Ensure that when reachability affects a phi of ops, we recompute
;; it. Here, the phi node is marked for recomputation when bb7->bb3
@@ -505,10 +504,10 @@ declare i32* @wombat()
;; change in the verifier, as it goes from a constant value to a
;; phi of [true, false]
-define void @test12(i32* %p) {
+define void @test12(ptr %p) {
; CHECK-LABEL: @test12(
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[TMP:%.*]] = load i32, i32* %p
+; CHECK-NEXT: [[TMP:%.*]] = load i32, ptr %p
; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt i32 [[TMP]], 0
; CHECK-NEXT: br i1 [[TMP1]], label [[BB2:%.*]], label [[BB8:%.*]]
; CHECK: bb2:
@@ -523,7 +522,7 @@ define void @test12(i32* %p) {
; CHECK-NEXT: ret void
;
bb:
- %tmp = load i32, i32* %p
+ %tmp = load i32, ptr %p
%tmp1 = icmp sgt i32 %tmp, 0
br i1 %tmp1, label %bb2, label %bb8
@@ -552,16 +551,16 @@ define void @test13() {
; CHECK-NEXT: bb:
; CHECK-NEXT: br label [[BB1:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[TMP:%.*]] = load i8, i8* null
+; CHECK-NEXT: [[TMP:%.*]] = load i8, ptr null
; CHECK-NEXT: br label [[BB3:%.*]]
; CHECK: bb3:
; CHECK-NEXT: [[PHIOFOPS:%.*]] = phi i8 [ [[TMP]], [[BB1]] ], [ [[TMP10:%.*]], [[BB3]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = phi i8* [ null, [[BB1]] ], [ [[TMP6:%.*]], [[BB3]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = phi ptr [ null, [[BB1]] ], [ [[TMP6:%.*]], [[BB3]] ]
; CHECK-NEXT: [[TMP5:%.*]] = phi i32 [ undef, [[BB1]] ], [ [[TMP9:%.*]], [[BB3]] ]
-; CHECK-NEXT: [[TMP6]] = getelementptr i8, i8* [[TMP4]], i64 1
+; CHECK-NEXT: [[TMP6]] = getelementptr i8, ptr [[TMP4]], i64 1
; CHECK-NEXT: [[TMP8:%.*]] = sext i8 [[PHIOFOPS]] to i32
; CHECK-NEXT: [[TMP9]] = mul i32 [[TMP5]], [[TMP8]]
-; CHECK-NEXT: [[TMP10]] = load i8, i8* [[TMP6]]
+; CHECK-NEXT: [[TMP10]] = load i8, ptr [[TMP6]]
; CHECK-NEXT: [[TMP11:%.*]] = icmp eq i8 [[TMP10]], 0
; CHECK-NEXT: br i1 [[TMP11]], label [[BB12:%.*]], label [[BB3]]
; CHECK: bb12:
@@ -575,18 +574,18 @@ bb:
br label %bb1
bb1: ; preds = %bb15, %bb12, %bb
- %tmp = load i8, i8* null
+ %tmp = load i8, ptr null
%tmp2 = icmp eq i8 %tmp, 8
br label %bb3
bb3: ; preds = %bb3, %bb1
- %tmp4 = phi i8* [ null, %bb1 ], [ %tmp6, %bb3 ]
+ %tmp4 = phi ptr [ null, %bb1 ], [ %tmp6, %bb3 ]
%tmp5 = phi i32 [ undef, %bb1 ], [ %tmp9, %bb3 ]
- %tmp6 = getelementptr i8, i8* %tmp4, i64 1
- %tmp7 = load i8, i8* %tmp4
+ %tmp6 = getelementptr i8, ptr %tmp4, i64 1
+ %tmp7 = load i8, ptr %tmp4
%tmp8 = sext i8 %tmp7 to i32
%tmp9 = mul i32 %tmp5, %tmp8
- %tmp10 = load i8, i8* %tmp6
+ %tmp10 = load i8, ptr %tmp6
%tmp11 = icmp eq i8 %tmp10, 0
br i1 %tmp11, label %bb12, label %bb3
diff --git a/llvm/test/Transforms/NewGVN/cond_br.ll b/llvm/test/Transforms/NewGVN/cond_br.ll
index 0123ec5ae3cb..3dbeb394c7cf 100644
--- a/llvm/test/Transforms/NewGVN/cond_br.ll
+++ b/llvm/test/Transforms/NewGVN/cond_br.ll
@@ -5,11 +5,11 @@
; Function Attrs: nounwind ssp uwtable
define void @foo(i32 %x) {
; CHECK: @foo(i32 %x)
-; CHECK: %.pre = load i32, i32* @y
+; CHECK: %.pre = load i32, ptr @y
; CHECK: call void @bar(i32 %.pre)
%t = sub i32 %x, %x
- %.pre = load i32, i32* @y, align 4
+ %.pre = load i32, ptr @y, align 4
%cmp = icmp sgt i32 %t, 2
br i1 %cmp, label %if.then, label %entry.if.end_crit_edge
@@ -18,7 +18,7 @@ entry.if.end_crit_edge: ; preds = %entry
if.then: ; preds = %entry
%add = add nsw i32 %x, 3
- store i32 %add, i32* @y, align 4
+ store i32 %add, ptr @y, align 4
br label %if.end
if.end: ; preds = %entry.if.end_crit_edge, %if.then
@@ -29,21 +29,21 @@ if.end: ; preds = %entry.if.end_crit_e
define void @foo2(i32 %x) {
; CHECK: @foo2(i32 %x)
-; CHECK: %.pre = load i32, i32* @y
+; CHECK: %.pre = load i32, ptr @y
; CHECK: tail call void @bar(i32 %.pre)
entry:
%t = sub i32 %x, %x
- %.pre = load i32, i32* @y, align 4
+ %.pre = load i32, ptr @y, align 4
%cmp = icmp sgt i32 %t, 2
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%add = add nsw i32 %x, 3
- store i32 %add, i32* @y, align 4
+ store i32 %add, ptr @y, align 4
br label %if.end
if.else: ; preds = %entry
- store i32 1, i32* @z, align 4
+ store i32 1, ptr @z, align 4
br label %if.end
if.end: ; preds = %if.else, %if.then
diff --git a/llvm/test/Transforms/NewGVN/cond_br2-xfail.ll b/llvm/test/Transforms/NewGVN/cond_br2-xfail.ll
index a74afd65ea68..017f608aaa63 100644
--- a/llvm/test/Transforms/NewGVN/cond_br2-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/cond_br2-xfail.ll
@@ -6,11 +6,11 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
%"class.llvm::SmallVectorImpl" = type { %"class.llvm::SmallVectorTemplateBase" }
%"class.llvm::SmallVectorTemplateBase" = type { %"class.llvm::SmallVectorTemplateCommon" }
%"class.llvm::SmallVectorTemplateCommon" = type { %"class.llvm::SmallVectorBase" }
-%"class.llvm::SmallVectorBase" = type { i8*, i8*, i8*, %"union.llvm::SmallVectorBase::U" }
+%"class.llvm::SmallVectorBase" = type { ptr, ptr, ptr, %"union.llvm::SmallVectorBase::U" }
%"union.llvm::SmallVectorBase::U" = type { x86_fp80 }
; Function Attrs: ssp uwtable
-define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define void @_Z4testv() #0 personality ptr @__gxx_personality_v0 {
; CHECK: @_Z4testv()
; CHECK: invoke.cont:
; CHECK: br i1 true, label %new.notnull.i11, label %if.end.i14
@@ -18,115 +18,107 @@ define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__gxx_personalit
entry:
%sv = alloca %"class.llvm::SmallVector", align 16
- %0 = bitcast %"class.llvm::SmallVector"* %sv to i8*
- call void @llvm.lifetime.start.p0i8(i64 64, i8* %0) #1
- %BeginX.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0
- %FirstEl.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 3
- %1 = bitcast %"union.llvm::SmallVectorBase::U"* %FirstEl.i.i.i.i.i.i to i8*
- store i8* %1, i8** %BeginX.i.i.i.i.i.i, align 16, !tbaa !4
- %EndX.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 1
- store i8* %1, i8** %EndX.i.i.i.i.i.i, align 8, !tbaa !4
- %CapacityX.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 2
- %add.ptr.i.i.i.i2.i.i = getelementptr inbounds %"union.llvm::SmallVectorBase::U", %"union.llvm::SmallVectorBase::U"* %FirstEl.i.i.i.i.i.i, i64 2
- %add.ptr.i.i.i.i.i.i = bitcast %"union.llvm::SmallVectorBase::U"* %add.ptr.i.i.i.i2.i.i to i8*
- store i8* %add.ptr.i.i.i.i.i.i, i8** %CapacityX.i.i.i.i.i.i, align 16, !tbaa !4
- %EndX.i = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 1
- %2 = load i8*, i8** %EndX.i, align 8, !tbaa !4
- %CapacityX.i = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 2
- %cmp.i = icmp ult i8* %2, %add.ptr.i.i.i.i.i.i
+ call void @llvm.lifetime.start.p0(i64 64, ptr %sv) #1
+ %FirstEl.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector", ptr %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 3
+ store ptr %FirstEl.i.i.i.i.i.i, ptr %sv, align 16, !tbaa !4
+ %EndX.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector", ptr %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 1
+ store ptr %FirstEl.i.i.i.i.i.i, ptr %EndX.i.i.i.i.i.i, align 8, !tbaa !4
+ %CapacityX.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector", ptr %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 2
+ %add.ptr.i.i.i.i2.i.i = getelementptr inbounds %"union.llvm::SmallVectorBase::U", ptr %FirstEl.i.i.i.i.i.i, i64 2
+ store ptr %add.ptr.i.i.i.i2.i.i, ptr %CapacityX.i.i.i.i.i.i, align 16, !tbaa !4
+ %EndX.i = getelementptr inbounds %"class.llvm::SmallVector", ptr %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 1
+ %0 = load ptr, ptr %EndX.i, align 8, !tbaa !4
+ %CapacityX.i = getelementptr inbounds %"class.llvm::SmallVector", ptr %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 2
+ %cmp.i = icmp ult ptr %0, %add.ptr.i.i.i.i2.i.i
br i1 %cmp.i, label %Retry.i, label %if.end.i
Retry.i: ; preds = %.noexc, %entry
- %3 = phi i8* [ %2, %entry ], [ %.pre.i, %.noexc ]
- %new.isnull.i = icmp eq i8* %3, null
+ %1 = phi ptr [ %0, %entry ], [ %.pre.i, %.noexc ]
+ %new.isnull.i = icmp eq ptr %1, null
br i1 %new.isnull.i, label %invoke.cont, label %new.notnull.i
new.notnull.i: ; preds = %Retry.i
- %4 = bitcast i8* %3 to i32*
- store i32 1, i32* %4, align 4, !tbaa !5
+ store i32 1, ptr %1, align 4, !tbaa !5
br label %invoke.cont
if.end.i: ; preds = %entry
- %5 = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0
- invoke void @_ZN4llvm15SmallVectorBase8grow_podEmm(%"class.llvm::SmallVectorBase"* %5, i64 0, i64 4)
+ invoke void @_ZN4llvm15SmallVectorBase8grow_podEmm(ptr %sv, i64 0, i64 4)
to label %.noexc unwind label %lpad
.noexc: ; preds = %if.end.i
- %.pre.i = load i8*, i8** %EndX.i, align 8, !tbaa !4
+ %.pre.i = load ptr, ptr %EndX.i, align 8, !tbaa !4
br label %Retry.i
invoke.cont: ; preds = %new.notnull.i, %Retry.i
- %add.ptr.i = getelementptr inbounds i8, i8* %3, i64 4
- store i8* %add.ptr.i, i8** %EndX.i, align 8, !tbaa !4
- %6 = load i8*, i8** %CapacityX.i, align 16, !tbaa !4
- %cmp.i8 = icmp ult i8* %add.ptr.i, %6
+ %add.ptr.i = getelementptr inbounds i8, ptr %1, i64 4
+ store ptr %add.ptr.i, ptr %EndX.i, align 8, !tbaa !4
+ %2 = load ptr, ptr %CapacityX.i, align 16, !tbaa !4
+ %cmp.i8 = icmp ult ptr %add.ptr.i, %2
br i1 %cmp.i8, label %new.notnull.i11, label %if.end.i14
Retry.i10: ; preds = %if.end.i14
- %.pre.i13 = load i8*, i8** %EndX.i, align 8, !tbaa !4
- %new.isnull.i9 = icmp eq i8* %.pre.i13, null
+ %.pre.i13 = load ptr, ptr %EndX.i, align 8, !tbaa !4
+ %new.isnull.i9 = icmp eq ptr %.pre.i13, null
br i1 %new.isnull.i9, label %invoke.cont2, label %new.notnull.i11
new.notnull.i11: ; preds = %invoke.cont, %Retry.i10
- %7 = phi i8* [ %.pre.i13, %Retry.i10 ], [ %add.ptr.i, %invoke.cont ]
- %8 = bitcast i8* %7 to i32*
- store i32 2, i32* %8, align 4, !tbaa !5
+ %3 = phi ptr [ %.pre.i13, %Retry.i10 ], [ %add.ptr.i, %invoke.cont ]
+ store i32 2, ptr %3, align 4, !tbaa !5
br label %invoke.cont2
if.end.i14: ; preds = %invoke.cont
- %9 = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0
- invoke void @_ZN4llvm15SmallVectorBase8grow_podEmm(%"class.llvm::SmallVectorBase"* %9, i64 0, i64 4)
+ invoke void @_ZN4llvm15SmallVectorBase8grow_podEmm(ptr %sv, i64 0, i64 4)
to label %Retry.i10 unwind label %lpad
invoke.cont2: ; preds = %new.notnull.i11, %Retry.i10
- %10 = phi i8* [ null, %Retry.i10 ], [ %7, %new.notnull.i11 ]
- %add.ptr.i12 = getelementptr inbounds i8, i8* %10, i64 4
- store i8* %add.ptr.i12, i8** %EndX.i, align 8, !tbaa !4
- invoke void @_Z1gRN4llvm11SmallVectorIiLj8EEE(%"class.llvm::SmallVector"* %sv)
+ %4 = phi ptr [ null, %Retry.i10 ], [ %3, %new.notnull.i11 ]
+ %add.ptr.i12 = getelementptr inbounds i8, ptr %4, i64 4
+ store ptr %add.ptr.i12, ptr %EndX.i, align 8, !tbaa !4
+ invoke void @_Z1gRN4llvm11SmallVectorIiLj8EEE(ptr %sv)
to label %invoke.cont3 unwind label %lpad
invoke.cont3: ; preds = %invoke.cont2
- %11 = load i8*, i8** %BeginX.i.i.i.i.i.i, align 16, !tbaa !4
- %cmp.i.i.i.i19 = icmp eq i8* %11, %1
+ %5 = load ptr, ptr %sv, align 16, !tbaa !4
+ %cmp.i.i.i.i19 = icmp eq ptr %5, %FirstEl.i.i.i.i.i.i
br i1 %cmp.i.i.i.i19, label %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit21, label %if.then.i.i.i20
if.then.i.i.i20: ; preds = %invoke.cont3
- call void @free(i8* %11) #1
+ call void @free(ptr %5) #1
br label %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit21
_ZN4llvm11SmallVectorIiLj8EED1Ev.exit21: ; preds = %invoke.cont3, %if.then.i.i.i20
- call void @llvm.lifetime.end.p0i8(i64 64, i8* %0) #1
+ call void @llvm.lifetime.end.p0(i64 64, ptr %sv) #1
ret void
lpad: ; preds = %if.end.i14, %if.end.i, %invoke.cont2
- %12 = landingpad { i8*, i32 }
+ %6 = landingpad { ptr, i32 }
cleanup
- %13 = load i8*, i8** %BeginX.i.i.i.i.i.i, align 16, !tbaa !4
- %cmp.i.i.i.i = icmp eq i8* %13, %1
+ %7 = load ptr, ptr %sv, align 16, !tbaa !4
+ %cmp.i.i.i.i = icmp eq ptr %7, %FirstEl.i.i.i.i.i.i
br i1 %cmp.i.i.i.i, label %eh.resume, label %if.then.i.i.i
if.then.i.i.i: ; preds = %lpad
- call void @free(i8* %13) #1
+ call void @free(ptr %7) #1
br label %eh.resume
eh.resume: ; preds = %if.then.i.i.i, %lpad
- resume { i8*, i32 } %12
+ resume { ptr, i32 } %6
}
; Function Attrs: nounwind
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
declare i32 @__gxx_personality_v0(...)
-declare void @_Z1gRN4llvm11SmallVectorIiLj8EEE(%"class.llvm::SmallVector"*) #2
+declare void @_Z1gRN4llvm11SmallVectorIiLj8EEE(ptr) #2
; Function Attrs: nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
-declare void @_ZN4llvm15SmallVectorBase8grow_podEmm(%"class.llvm::SmallVectorBase"*, i64, i64) #2
+declare void @_ZN4llvm15SmallVectorBase8grow_podEmm(ptr, i64, i64) #2
; Function Attrs: nounwind
-declare void @free(i8* nocapture) #3
+declare void @free(ptr nocapture) #3
attributes #0 = { ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind }
diff --git a/llvm/test/Transforms/NewGVN/condprop-xfail.ll b/llvm/test/Transforms/NewGVN/condprop-xfail.ll
index a6a9b52c5f77..b5a63bc5a64d 100644
--- a/llvm/test/Transforms/NewGVN/condprop-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/condprop-xfail.ll
@@ -1,13 +1,13 @@
; XFAIL: *
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
- at a = external global i32 ; <i32*> [#uses=7]
+ at a = external global i32 ; <ptr> [#uses=7]
;; NewGVN takes two passes to get this, because we prune predicateinfo
; CHECK-LABEL: @test1(
define i32 @test1() nounwind {
entry:
- %0 = load i32, i32* @a, align 4
+ %0 = load i32, ptr @a, align 4
%1 = icmp eq i32 %0, 4
br i1 %1, label %bb, label %bb1
@@ -15,7 +15,7 @@ bb: ; preds = %entry
br label %bb8
bb1: ; preds = %entry
- %2 = load i32, i32* @a, align 4
+ %2 = load i32, ptr @a, align 4
%3 = icmp eq i32 %2, 5
br i1 %3, label %bb2, label %bb3
@@ -23,29 +23,29 @@ bb2: ; preds = %bb1
br label %bb8
bb3: ; preds = %bb1
- %4 = load i32, i32* @a, align 4
+ %4 = load i32, ptr @a, align 4
%5 = icmp eq i32 %4, 4
; CHECK: br i1 false, label %bb4, label %bb5
br i1 %5, label %bb4, label %bb5
bb4: ; preds = %bb3
- %6 = load i32, i32* @a, align 4
+ %6 = load i32, ptr @a, align 4
%7 = add i32 %6, 5
br label %bb8
bb5: ; preds = %bb3
- %8 = load i32, i32* @a, align 4
+ %8 = load i32, ptr @a, align 4
%9 = icmp eq i32 %8, 5
; CHECK: br i1 false, label %bb6, label %bb7
br i1 %9, label %bb6, label %bb7
bb6: ; preds = %bb5
- %10 = load i32, i32* @a, align 4
+ %10 = load i32, ptr @a, align 4
%11 = add i32 %10, 4
br label %bb8
bb7: ; preds = %bb5
- %12 = load i32, i32* @a, align 4
+ %12 = load i32, ptr @a, align 4
br label %bb8
bb8: ; preds = %bb7, %bb6, %bb4, %bb2, %bb
diff --git a/llvm/test/Transforms/NewGVN/crash-no-aa.ll b/llvm/test/Transforms/NewGVN/crash-no-aa.ll
index 4cca5b71f3a9..55e2bcb00fb7 100644
--- a/llvm/test/Transforms/NewGVN/crash-no-aa.ll
+++ b/llvm/test/Transforms/NewGVN/crash-no-aa.ll
@@ -4,12 +4,12 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
target triple = "x86_64-unknown-freebsd8.0"
; PR5744
-define i32 @test1({i16, i32} *%P) {
- %P2 = getelementptr {i16, i32}, {i16, i32} *%P, i32 0, i32 0
- store i16 42, i16* %P2
+define i32 @test1(ptr %P) {
+ %P2 = getelementptr {i16, i32}, ptr %P, i32 0, i32 0
+ store i16 42, ptr %P2
- %P3 = getelementptr {i16, i32}, {i16, i32} *%P, i32 0, i32 1
- %V = load i32, i32* %P3
+ %P3 = getelementptr {i16, i32}, ptr %P, i32 0, i32 1
+ %V = load i32, ptr %P3
ret i32 %V
}
diff --git a/llvm/test/Transforms/NewGVN/crash.ll b/llvm/test/Transforms/NewGVN/crash.ll
index d882a5d92853..c886bd384eee 100644
--- a/llvm/test/Transforms/NewGVN/crash.ll
+++ b/llvm/test/Transforms/NewGVN/crash.ll
@@ -5,7 +5,7 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-darwin10.0"
-define i32* @test1(i8* %name, i32 %namelen, i32* %o, i32 %expected_type) nounwind ssp {
+define ptr @test1(ptr %name, i32 %namelen, ptr %o, i32 %expected_type) nounwind ssp {
entry:
br i1 undef, label %if.end13, label %while.body.preheader
@@ -17,28 +17,26 @@ while.body.preheader: ; preds = %if.end13, %if.end
br label %while.body
while.body: ; preds = %while.body.backedge, %while.body.preheader
- %o.addr.0 = phi i32* [ undef, %while.body.preheader ], [ %o.addr.0.be, %while.body.backedge ] ; <i32*> [#uses=2]
+ %o.addr.0 = phi ptr [ undef, %while.body.preheader ], [ %o.addr.0.be, %while.body.backedge ] ; <ptr> [#uses=2]
br i1 false, label %return.loopexit, label %lor.lhs.false
lor.lhs.false: ; preds = %while.body
- %tmp20 = bitcast i32* %o.addr.0 to i32* ; <i32*> [#uses=1]
- %tmp22 = load i32, i32* %tmp20 ; <i32> [#uses=0]
+ %tmp22 = load i32, ptr %o.addr.0 ; <i32> [#uses=0]
br i1 undef, label %land.lhs.true24, label %if.end31
land.lhs.true24: ; preds = %lor.lhs.false
- %call28 = call i32* @parse_object(i8* undef) nounwind ; <i32*> [#uses=0]
+ %call28 = call ptr @parse_object(ptr undef) nounwind ; <ptr> [#uses=0]
br i1 undef, label %return.loopexit, label %if.end31
if.end31: ; preds = %land.lhs.true24, %lor.lhs.false
br i1 undef, label %return.loopexit, label %if.end41
if.end41: ; preds = %if.end31
- %tmp43 = bitcast i32* %o.addr.0 to i32* ; <i32*> [#uses=1]
- %tmp45 = load i32, i32* %tmp43 ; <i32> [#uses=0]
+ %tmp45 = load i32, ptr %o.addr.0 ; <i32> [#uses=0]
br i1 undef, label %if.then50, label %if.else
if.then50: ; preds = %if.end41
- %tmp53 = load i32*, i32** undef ; <i32*> [#uses=1]
+ %tmp53 = load ptr, ptr undef ; <ptr> [#uses=1]
br label %while.body.backedge
if.else: ; preds = %if.end41
@@ -48,42 +46,42 @@ if.then62: ; preds = %if.else
br label %while.body.backedge
while.body.backedge: ; preds = %if.then62, %if.then50
- %o.addr.0.be = phi i32* [ %tmp53, %if.then50 ], [ undef, %if.then62 ] ; <i32*> [#uses=1]
+ %o.addr.0.be = phi ptr [ %tmp53, %if.then50 ], [ undef, %if.then62 ] ; <ptr> [#uses=1]
br label %while.body
if.else67: ; preds = %if.else
- ret i32* null
+ ret ptr null
return.loopexit: ; preds = %if.end31, %land.lhs.true24, %while.body
- ret i32* undef
+ ret ptr undef
}
-declare i32* @parse_object(i8*)
+declare ptr @parse_object(ptr)
-%struct.attribute_spec = type { i8*, i32, i32, i8, i8, i8 }
+%struct.attribute_spec = type { ptr, i32, i32, i8, i8, i8 }
- at attribute_tables = external global [4 x %struct.attribute_spec*] ; <[4 x %struct.attribute_spec*]*> [#uses=2]
+ at attribute_tables = external global [4 x ptr] ; <ptr> [#uses=2]
define void @test2() nounwind {
entry:
br label %bb69.i
bb69.i: ; preds = %bb57.i.preheader
- %tmp4 = getelementptr inbounds [4 x %struct.attribute_spec*], [4 x %struct.attribute_spec*]* @attribute_tables, i32 0, i32 undef ; <%struct.attribute_spec**> [#uses=1]
- %tmp3 = load %struct.attribute_spec*, %struct.attribute_spec** %tmp4, align 4 ; <%struct.attribute_spec*> [#uses=1]
+ %tmp4 = getelementptr inbounds [4 x ptr], ptr @attribute_tables, i32 0, i32 undef ; <ptr> [#uses=1]
+ %tmp3 = load ptr, ptr %tmp4, align 4 ; <ptr> [#uses=1]
br label %bb65.i
bb65.i: ; preds = %bb65.i.preheader, %bb64.i
%storemerge6.i = phi i32 [ 1, %bb64.i ], [ 0, %bb69.i ] ; <i32> [#uses=3]
- %scevgep14 = getelementptr inbounds %struct.attribute_spec, %struct.attribute_spec* %tmp3, i32 %storemerge6.i, i32 0 ; <i8**> [#uses=1]
- %tmp2 = load i8*, i8** %scevgep14, align 4 ; <i8*> [#uses=0]
- %tmp = load %struct.attribute_spec*, %struct.attribute_spec** %tmp4, align 4 ; <%struct.attribute_spec*> [#uses=1]
- %scevgep1516 = getelementptr inbounds %struct.attribute_spec, %struct.attribute_spec* %tmp, i32 %storemerge6.i, i32 0 ; <i8**> [#uses=0]
+ %scevgep14 = getelementptr inbounds %struct.attribute_spec, ptr %tmp3, i32 %storemerge6.i, i32 0 ; <ptr> [#uses=1]
+ %tmp2 = load ptr, ptr %scevgep14, align 4 ; <ptr> [#uses=0]
+ %tmp = load ptr, ptr %tmp4, align 4 ; <ptr> [#uses=1]
+ %scevgep1516 = getelementptr inbounds %struct.attribute_spec, ptr %tmp, i32 %storemerge6.i, i32 0 ; <ptr> [#uses=0]
unreachable
bb64.i: ; Unreachable
@@ -99,23 +97,19 @@ bb66.i: ; Unreachable
@g = external global i64, align 8
-define i32* @test3() {
+define ptr @test3() {
do.end17.i:
- %tmp18.i = load i7*, i7** undef
- %tmp1 = bitcast i7* %tmp18.i to i8*
+ %tmp18.i = load ptr, ptr undef
br i1 undef, label %do.body36.i, label %if.then21.i
if.then21.i:
- %tmp2 = bitcast i7* %tmp18.i to i8*
- ret i32* undef
+ ret ptr undef
do.body36.i:
- %ivar38.i = load i64, i64* @g
- %tmp3 = bitcast i7* %tmp18.i to i8*
+ %ivar38.i = load i64, ptr @g
%add.ptr39.sum.i = add i64 %ivar38.i, 8
- %tmp40.i = getelementptr inbounds i8, i8* %tmp3, i64 %add.ptr39.sum.i
- %tmp4 = bitcast i8* %tmp40.i to i64*
- %tmp41.i = load i64, i64* %tmp4
+ %tmp40.i = getelementptr inbounds i8, ptr %tmp18.i, i64 %add.ptr39.sum.i
+ %tmp41.i = load i64, ptr %tmp40.i
br i1 undef, label %if.then48.i, label %do.body57.i
if.then48.i:
@@ -123,14 +117,12 @@ if.then48.i:
br label %do.body57.i
do.body57.i:
- %tmp58.i = load i7*, i7** undef
- %ivar59.i = load i64, i64* @g
- %tmp5 = bitcast i7* %tmp58.i to i8*
+ %tmp58.i = load ptr, ptr undef
+ %ivar59.i = load i64, ptr @g
%add.ptr65.sum.i = add i64 %ivar59.i, 8
- %tmp66.i = getelementptr inbounds i8, i8* %tmp5, i64 %add.ptr65.sum.i
- %tmp6 = bitcast i8* %tmp66.i to i64*
- %tmp67.i = load i64, i64* %tmp6
- ret i32* undef
+ %tmp66.i = getelementptr inbounds i8, ptr %tmp58.i, i64 %add.ptr65.sum.i
+ %tmp67.i = load i64, ptr %tmp66.i
+ ret ptr undef
}
declare i32 @foo2()
@@ -142,10 +134,10 @@ entry:
ret i32 0
dead:
- %P2 = getelementptr i32, i32 *%P2, i32 52
- %Q2 = getelementptr i32, i32 *%Q2, i32 52
- store i32 4, i32* %P2
- %A = load i32, i32* %Q2
+ %P2 = getelementptr i32, ptr %P2, i32 52
+ %Q2 = getelementptr i32, ptr %Q2, i32 52
+ store i32 4, ptr %P2
+ %A = load i32, ptr %Q2
br i1 true, label %dead, label %dead2
dead2:
@@ -154,12 +146,12 @@ dead2:
; PR9841
-define fastcc i8 @test5(i8* %P) nounwind {
+define fastcc i8 @test5(ptr %P) nounwind {
entry:
- %0 = load i8, i8* %P, align 2
+ %0 = load i8, ptr %P, align 2
- %Q = getelementptr i8, i8* %P, i32 1
- %1 = load i8, i8* %Q, align 1
+ %Q = getelementptr i8, ptr %P, i32 1
+ %1 = load i8, ptr %Q, align 1
ret i8 %1
}
@@ -178,16 +170,15 @@ entry:
;; Unreachable code.
unreachable.bb:
- %gep.val = getelementptr inbounds %struct.type, %struct.type* %gep.val, i64 1
+ %gep.val = getelementptr inbounds %struct.type, ptr %gep.val, i64 1
br i1 undef, label %u2.bb, label %u1.bb
u1.bb:
- %tmp1 = getelementptr inbounds %struct.type, %struct.type* %gep.val, i64 0, i32 0
- store i64 -1, i64* %tmp1, align 8
+ store i64 -1, ptr %gep.val, align 8
br label %unreachable.bb
u2.bb:
- %0 = load i32, i32* undef, align 4
+ %0 = load i32, ptr undef, align 4
%conv.i.i.i.i.i = zext i32 %0 to i64
br label %u2.bb
diff --git a/llvm/test/Transforms/NewGVN/cyclic-phi-handling.ll b/llvm/test/Transforms/NewGVN/cyclic-phi-handling.ll
index 5127edacbd52..4a2f0b972c9f 100644
--- a/llvm/test/Transforms/NewGVN/cyclic-phi-handling.ll
+++ b/llvm/test/Transforms/NewGVN/cyclic-phi-handling.ll
@@ -2,7 +2,7 @@
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-define void @foo(i32 %arg, i32 %arg1, i32 (i32, i32)* %arg2) {
+define void @foo(i32 %arg, i32 %arg1, ptr %arg2) {
; CHECK-LABEL: @foo(
; CHECK-NEXT: bb:
; CHECK-NEXT: br label %bb3
diff --git a/llvm/test/Transforms/NewGVN/dbg-redundant-load.ll b/llvm/test/Transforms/NewGVN/dbg-redundant-load.ll
index cb3fe9e27a0b..01d95aebdf2d 100644
--- a/llvm/test/Transforms/NewGVN/dbg-redundant-load.ll
+++ b/llvm/test/Transforms/NewGVN/dbg-redundant-load.ll
@@ -8,20 +8,20 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; CHECK: @test_redundant_load(
; CHECK-LABEL: entry:
-; CHECK-NEXT: load i32, i32* %Y, align 4, !dbg ![[LOC:[0-9]+]]
+; CHECK-NEXT: load i32, ptr %Y, align 4, !dbg ![[LOC:[0-9]+]]
; CHECK-LABEL: if.then:
; CHECK-NOT: load
; CHECK-LABEL: if.end:
; CHECK: ![[LOC]] = !DILocation(line: 3, scope: !{{.*}})
-define i32 @test_redundant_load(i32 %X, i32* %Y) !dbg !6 {
+define i32 @test_redundant_load(i32 %X, ptr %Y) !dbg !6 {
entry:
- %0 = load i32, i32* %Y, align 4, !dbg !8
+ %0 = load i32, ptr %Y, align 4, !dbg !8
%cmp = icmp sgt i32 %X, -1, !dbg !9
br i1 %cmp, label %if.then, label %if.end, !dbg !9
if.then: ; preds = %entry
- %1 = load i32, i32* %Y, align 4, !dbg !10
+ %1 = load i32, ptr %Y, align 4, !dbg !10
%add = add nsw i32 %0, %1, !dbg !10
call void @foo(), !dbg !11
br label %if.end, !dbg !12
diff --git a/llvm/test/Transforms/NewGVN/deadstore.ll b/llvm/test/Transforms/NewGVN/deadstore.ll
index 3c4ed0fdc090..ef8bdf38b658 100644
--- a/llvm/test/Transforms/NewGVN/deadstore.ll
+++ b/llvm/test/Transforms/NewGVN/deadstore.ll
@@ -5,30 +5,29 @@
;; NewGVN should be able to eliminate any stores of the same value that are actually redundnat.
;; tmp5 is store of the same value to the same location as the load.
-define void @test12({ i32, i32 }* %x) nounwind {
+define void @test12(ptr %x) nounwind {
; CHECK-LABEL: @test12(
-; CHECK-NEXT: [[TMP4:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[X:%.*]], i32 0, i32 0
-; CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4
-; CHECK-NEXT: [[TMP7:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[X]], i32 0, i32 1
-; CHECK-NEXT: [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4
+; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[X:%.*]], align 4
+; CHECK-NEXT: [[TMP7:%.*]] = getelementptr { i32, i32 }, ptr [[X]], i32 0, i32 1
+; CHECK-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
; CHECK-NEXT: [[TMP17:%.*]] = sub i32 0, [[TMP8]]
-; CHECK-NEXT: store i32 [[TMP17]], i32* [[TMP7]], align 4
+; CHECK-NEXT: store i32 [[TMP17]], ptr [[TMP7]], align 4
; CHECK-NEXT: ret void
;
- %tmp4 = getelementptr { i32, i32 }, { i32, i32 }* %x, i32 0, i32 0
- %tmp5 = load i32, i32* %tmp4, align 4
- %tmp7 = getelementptr { i32, i32 }, { i32, i32 }* %x, i32 0, i32 1
- %tmp8 = load i32, i32* %tmp7, align 4
+ %tmp4 = getelementptr { i32, i32 }, ptr %x, i32 0, i32 0
+ %tmp5 = load i32, ptr %tmp4, align 4
+ %tmp7 = getelementptr { i32, i32 }, ptr %x, i32 0, i32 1
+ %tmp8 = load i32, ptr %tmp7, align 4
%tmp17 = sub i32 0, %tmp8
- store i32 %tmp5, i32* %tmp4, align 4
- store i32 %tmp17, i32* %tmp7, align 4
+ store i32 %tmp5, ptr %tmp4, align 4
+ store i32 %tmp17, ptr %tmp7, align 4
ret void
}
; Remove redundant store if loaded value is in another block.
-define i32 @test26(i1 %c, i32* %p) {
+define i32 @test26(i1 %c, ptr %p) {
; CHECK-LABEL: @test26(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[V:%.*]] = load i32, i32* [[P:%.*]], align 4
+; CHECK-NEXT: [[V:%.*]] = load i32, ptr [[P:%.*]], align 4
; CHECK-NEXT: br i1 [[C:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
; CHECK-NEXT: br label [[BB3:%.*]]
@@ -38,12 +37,12 @@ define i32 @test26(i1 %c, i32* %p) {
; CHECK-NEXT: ret i32 0
;
entry:
- %v = load i32, i32* %p, align 4
+ %v = load i32, ptr %p, align 4
br i1 %c, label %bb1, label %bb2
bb1:
br label %bb3
bb2:
- store i32 %v, i32* %p, align 4
+ store i32 %v, ptr %p, align 4
br label %bb3
bb3:
ret i32 0
@@ -51,12 +50,12 @@ bb3:
declare void @unknown_func()
; Remove redundant store, which is in the same loop as the load.
-define i32 @test33(i1 %c, i32* %p, i32 %i) {
+define i32 @test33(i1 %c, ptr %p, i32 %i) {
; CHECK-LABEL: @test33(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[BB1:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[V:%.*]] = load i32, i32* [[P:%.*]], align 4
+; CHECK-NEXT: [[V:%.*]] = load i32, ptr [[P:%.*]], align 4
; CHECK-NEXT: br label [[BB2:%.*]]
; CHECK: bb2:
; CHECK-NEXT: call void @unknown_func()
@@ -67,10 +66,10 @@ define i32 @test33(i1 %c, i32* %p, i32 %i) {
entry:
br label %bb1
bb1:
- %v = load i32, i32* %p, align 4
+ %v = load i32, ptr %p, align 4
br label %bb2
bb2:
- store i32 %v, i32* %p, align 4
+ store i32 %v, ptr %p, align 4
; Might read and overwrite value at %p, but doesn't matter.
call void @unknown_func()
br i1 undef, label %bb1, label %bb3
diff --git a/llvm/test/Transforms/NewGVN/debugloc-xfail.ll b/llvm/test/Transforms/NewGVN/debugloc-xfail.ll
index 1e3cb3087f49..ef098363ab55 100644
--- a/llvm/test/Transforms/NewGVN/debugloc-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/debugloc-xfail.ll
@@ -16,7 +16,7 @@ define void @foo(i32 %x, i32 %y, i32 %z) local_unnamed_addr #0 !dbg !4 {
entry:
%not.tobool = icmp eq i32 %x, 0, !dbg !8
%.sink = zext i1 %not.tobool to i32, !dbg !8
- store i32 %.sink, i32* @g, align 4, !tbaa !9
+ store i32 %.sink, ptr @g, align 4, !tbaa !9
%cmp8 = icmp sgt i32 %y, 0, !dbg !13
br i1 %cmp8, label %for.body.preheader, label %for.end, !dbg !17
@@ -29,9 +29,9 @@ for.body: ; preds = %for.body.preheader,
br i1 %cmp1, label %if.then2, label %for.inc, !dbg !21
if.then2: ; preds = %for.body
- %0 = load i32, i32* @g, align 4, !dbg !22, !tbaa !9
+ %0 = load i32, ptr @g, align 4, !dbg !22, !tbaa !9
%inc = add nsw i32 %0, 1, !dbg !22
- store i32 %inc, i32* @g, align 4, !dbg !22, !tbaa !9
+ store i32 %inc, ptr @g, align 4, !dbg !22, !tbaa !9
br label %for.inc, !dbg !23
for.inc: ; preds = %for.body, %if.then2
diff --git a/llvm/test/Transforms/NewGVN/edge.ll b/llvm/test/Transforms/NewGVN/edge.ll
index 4c9952a240c8..8699c85c9ed7 100644
--- a/llvm/test/Transforms/NewGVN/edge.ll
+++ b/llvm/test/Transforms/NewGVN/edge.ll
@@ -45,15 +45,15 @@ bb2:
}
declare void @g(i1)
-define void @f4(i8 * %x) {
+define void @f4(ptr %x) {
; CHECK-LABEL: define void @f4(
bb0:
- %y = icmp eq i8* null, %x
+ %y = icmp eq ptr null, %x
br i1 %y, label %bb2, label %bb1
bb1:
br label %bb2
bb2:
- %zed = icmp eq i8* null, %x
+ %zed = icmp eq ptr null, %x
call void @g(i1 %zed)
; CHECK: call void @g(i1 %y)
ret void
diff --git a/llvm/test/Transforms/NewGVN/eliminate-ssacopy.ll b/llvm/test/Transforms/NewGVN/eliminate-ssacopy.ll
index 2ebe3effe3d5..9dc83b747ca4 100644
--- a/llvm/test/Transforms/NewGVN/eliminate-ssacopy.ll
+++ b/llvm/test/Transforms/NewGVN/eliminate-ssacopy.ll
@@ -25,17 +25,17 @@ define void @g() {
; CHECK-NEXT: br label [[IF_END11_LOOPEXIT]]
; CHECK: if.end11.loopexit:
; CHECK-NEXT: [[STOREMERGE_LCSSA:%.*]] = phi i32 [ 0, [[FOR_COND6_PREHEADER]] ], [ 1, [[FOR_COND6_PREHEADER3]] ]
-; CHECK-NEXT: store i32 [[STOREMERGE_LCSSA]], i32* @b, align 4
+; CHECK-NEXT: store i32 [[STOREMERGE_LCSSA]], ptr @b, align 4
; CHECK-NEXT: br label [[IF_END11]]
; CHECK: if.end11:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @b, align 4
-; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* @a, align 1
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @b, align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load i8, ptr @a, align 1
; CHECK-NEXT: [[CONV:%.*]] = sext i8 [[TMP1]] to i32
; CHECK-NEXT: [[CMP12:%.*]] = icmp eq i32 [[TMP0]], [[CONV]]
; CHECK-NEXT: br i1 [[CMP12]], label [[IF_THEN14:%.*]], label [[IF_END16:%.*]]
; CHECK: if.then14:
; CHECK-NEXT: [[CONV15:%.*]] = trunc i32 [[TMP0]] to i16
-; CHECK-NEXT: store i16 [[CONV15]], i16* @f, align 2
+; CHECK-NEXT: store i16 [[CONV15]], ptr @f, align 2
; CHECK-NEXT: unreachable
; CHECK: if.end16:
; CHECK-NEXT: ret void
@@ -61,19 +61,19 @@ for.cond6.preheader3: ; preds = %for.cond6.preheader
if.end11.loopexit: ; preds = %for.cond6.preheader3, %for.cond6.preheader
%storemerge.lcssa = phi i32 [ 0, %for.cond6.preheader ], [ 1, %for.cond6.preheader3 ]
- store i32 %storemerge.lcssa, i32* @b, align 4
+ store i32 %storemerge.lcssa, ptr @b, align 4
br label %if.end11
if.end11: ; preds = %if.end11.loopexit, %for.end4.split
- %0 = load i32, i32* @b, align 4
- %1 = load i8, i8* @a, align 1
+ %0 = load i32, ptr @b, align 4
+ %1 = load i8, ptr @a, align 1
%conv = sext i8 %1 to i32
%cmp12 = icmp eq i32 %0, %conv
br i1 %cmp12, label %if.then14, label %if.end16
if.then14: ; preds = %if.end11
%conv15 = trunc i32 %0 to i16
- store i16 %conv15, i16* @f, align 2
+ store i16 %conv15, ptr @f, align 2
unreachable
if.end16: ; preds = %if.end11
diff --git a/llvm/test/Transforms/NewGVN/equivalent-phi.ll b/llvm/test/Transforms/NewGVN/equivalent-phi.ll
index b46bfabdadc1..925795d49af1 100644
--- a/llvm/test/Transforms/NewGVN/equivalent-phi.ll
+++ b/llvm/test/Transforms/NewGVN/equivalent-phi.ll
@@ -17,8 +17,8 @@ define i32 @bar(i32 %arg, i32 %arg1, i32 %arg2) #0 {
; CHECK-NEXT: [[TMP4:%.*]] = phi i32 [ %arg2, %bb ], [ [[TMP18:%.*]], %bb17 ]
; CHECK-NEXT: [[TMP6:%.*]] = phi i32 [ 0, %bb ], [ [[TMP14:%.*]], %bb17 ]
; CHECK-NEXT: [[TMP7:%.*]] = sext i32 [[TMP]] to i64
-; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* @global, i64 0, i64 [[TMP7]]
-; CHECK-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP8]], align 4
+; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1024 x i32], ptr @global, i64 0, i64 [[TMP7]]
+; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP8]], align 4
; CHECK-NEXT: [[TMP10:%.*]] = add nsw i32 [[TMP6]], [[TMP9]]
; CHECK-NEXT: [[TMP14]] = add nsw i32 [[TMP10]], [[TMP9]]
; CHECK-NEXT: [[TMP15:%.*]] = add nsw i32 [[TMP]], %arg1
@@ -39,12 +39,12 @@ bb3: ; preds = %bb17, %bb
%tmp5 = phi i32 [ %arg, %bb ], [ %tmp16, %bb17 ]
%tmp6 = phi i32 [ 0, %bb ], [ %tmp14, %bb17 ]
%tmp7 = sext i32 %tmp to i64
- %tmp8 = getelementptr inbounds [1024 x i32], [1024 x i32]* @global, i64 0, i64 %tmp7
- %tmp9 = load i32, i32* %tmp8, align 4
+ %tmp8 = getelementptr inbounds [1024 x i32], ptr @global, i64 0, i64 %tmp7
+ %tmp9 = load i32, ptr %tmp8, align 4
%tmp10 = add nsw i32 %tmp6, %tmp9
%tmp11 = sext i32 %tmp5 to i64
- %tmp12 = getelementptr inbounds [1024 x i32], [1024 x i32]* @global, i64 0, i64 %tmp11
- %tmp13 = load i32, i32* %tmp12, align 4
+ %tmp12 = getelementptr inbounds [1024 x i32], ptr @global, i64 0, i64 %tmp11
+ %tmp13 = load i32, ptr %tmp12, align 4
%tmp14 = add nsw i32 %tmp10, %tmp13
%tmp15 = add nsw i32 %tmp, %arg1
%tmp16 = add nsw i32 %tmp5, %arg1
diff --git a/llvm/test/Transforms/NewGVN/fence-xfail.ll b/llvm/test/Transforms/NewGVN/fence-xfail.ll
index 5bbf00d52edd..fffdd082b6ee 100644
--- a/llvm/test/Transforms/NewGVN/fence-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/fence-xfail.ll
@@ -4,27 +4,27 @@
@a = external constant i32
; We can value forward across the fence since we can (semantically)
; reorder the following load before the fence.
-define i32 @test(i32* %addr.i) {
+define i32 @test(ptr %addr.i) {
; CHECK-LABEL: @test
; CHECK: store
; CHECK: fence
; CHECK-NOT: load
; CHECK: ret
- store i32 5, i32* %addr.i, align 4
+ store i32 5, ptr %addr.i, align 4
fence release
- %a = load i32, i32* %addr.i, align 4
+ %a = load i32, ptr %addr.i, align 4
ret i32 %a
}
; Same as above
-define i32 @test2(i32* %addr.i) {
+define i32 @test2(ptr %addr.i) {
; CHECK-LABEL: @test2
; CHECK-NEXT: fence
; CHECK-NOT: load
; CHECK: ret
- %a = load i32, i32* %addr.i, align 4
+ %a = load i32, ptr %addr.i, align 4
fence release
- %a2 = load i32, i32* %addr.i, align 4
+ %a2 = load i32, ptr %addr.i, align 4
%res = sub i32 %a, %a2
ret i32 %res
}
@@ -35,7 +35,7 @@ define i32 @test2(i32* %addr.i) {
; ordering property (though it is that too), but a liveness
; property. We expect to eventually see the value of store by
; another thread when spinning on that location.
-define i32 @test3(i32* noalias %addr.i, i32* noalias %otheraddr) {
+define i32 @test3(ptr noalias %addr.i, ptr noalias %otheraddr) {
; CHECK-LABEL: @test3
; CHECK: load
; CHECK: fence
@@ -47,9 +47,9 @@ define i32 @test3(i32* noalias %addr.i, i32* noalias %otheraddr) {
; It's hopefully clear that allowing PRE to turn this into:
; if (!*%addr.i) while(true) {} would be unfortunate
fence acquire
- %a = load i32, i32* %addr.i, align 4
+ %a = load i32, ptr %addr.i, align 4
fence acquire
- %a2 = load i32, i32* %addr.i, align 4
+ %a2 = load i32, ptr %addr.i, align 4
%res = sub i32 %a, %a2
ret i32 %res
}
@@ -57,18 +57,18 @@ define i32 @test3(i32* noalias %addr.i, i32* noalias %otheraddr) {
; We can forward the value forward the load
; across both the fences, because the load is from
; a constant memory location.
-define i32 @test4(i32* %addr) {
+define i32 @test4(ptr %addr) {
; CHECK-LABEL: @test4
; CHECK-NOT: load
; CHECK: fence release
; CHECK: store
; CHECK: fence seq_cst
; CHECK: ret i32 0
- %var = load i32, i32* @a
+ %var = load i32, ptr @a
fence release
- store i32 42, i32* %addr, align 8
+ store i32 42, ptr %addr, align 8
fence seq_cst
- %var2 = load i32, i32* @a
+ %var2 = load i32, ptr @a
%var3 = sub i32 %var, %var2
ret i32 %var3
}
diff --git a/llvm/test/Transforms/NewGVN/flags-simplify.ll b/llvm/test/Transforms/NewGVN/flags-simplify.ll
index 8c4dad981f08..408a5a948f94 100644
--- a/llvm/test/Transforms/NewGVN/flags-simplify.ll
+++ b/llvm/test/Transforms/NewGVN/flags-simplify.ll
@@ -14,13 +14,13 @@ define i64 @ashr_lsh_nsw(i64 %tmp) {
; CHECK-LABEL: @ashr_lsh_nsw(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CONV3:%.*]] = shl i64 [[TMP:%.*]], 32
-; CHECK-NEXT: store i64 [[CONV3]], i64* @f, align 8
+; CHECK-NEXT: store i64 [[CONV3]], ptr @f, align 8
; CHECK-NEXT: [[CONV7:%.*]] = ashr exact i64 [[CONV3]], 32
; CHECK-NEXT: ret i64 [[CONV7]]
;
entry: ; preds = %if.then
%conv3 = shl nsw i64 %tmp, 32
- store i64 %conv3, i64* @f, align 8
+ store i64 %conv3, ptr @f, align 8
%sext = shl i64 %tmp, 32
%conv7 = ashr exact i64 %sext, 32
ret i64 %conv7
@@ -30,13 +30,13 @@ define i64 @ashr_lsh_nuw(i64 %tmp) {
; CHECK-LABEL: @ashr_lsh_nuw(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CONV3:%.*]] = shl i64 [[TMP:%.*]], 32
-; CHECK-NEXT: store i64 [[CONV3]], i64* @f, align 8
+; CHECK-NEXT: store i64 [[CONV3]], ptr @f, align 8
; CHECK-NEXT: [[CONV7:%.*]] = ashr exact i64 [[CONV3]], 32
; CHECK-NEXT: ret i64 [[CONV7]]
;
entry: ; preds = %if.then
%conv3 = shl nuw i64 %tmp, 32
- store i64 %conv3, i64* @f, align 8
+ store i64 %conv3, ptr @f, align 8
%sext = shl i64 %tmp, 32
%conv7 = ashr exact i64 %sext, 32
ret i64 %conv7
diff --git a/llvm/test/Transforms/NewGVN/fold-const-expr.ll b/llvm/test/Transforms/NewGVN/fold-const-expr.ll
index c4a139f40040..282179146949 100644
--- a/llvm/test/Transforms/NewGVN/fold-const-expr.ll
+++ b/llvm/test/Transforms/NewGVN/fold-const-expr.ll
@@ -7,11 +7,10 @@
%2 = type { i32, i32, i32, i32, i32 }
define i32 @_Z16vector3util_mainv(i32 %x, i32 %y) {
%tmp1 = alloca %2, align 4
- %tmp114 = getelementptr inbounds %2, %2* %tmp1, i64 0, i32 1
- %tmp115 = bitcast i32* %tmp114 to <4 x i32>*
- store <4 x i32> <i32 234567891, i32 345678912, i32 456789123, i32 0>, <4 x i32>* %tmp115, align 4
- %tmp1683 = getelementptr inbounds %2, %2* %tmp1, i64 0, i32 1
- %tmp1688 = load i32, i32* %tmp1683, align 4
+ %tmp114 = getelementptr inbounds %2, ptr %tmp1, i64 0, i32 1
+ store <4 x i32> <i32 234567891, i32 345678912, i32 456789123, i32 0>, ptr %tmp114, align 4
+ %tmp1683 = getelementptr inbounds %2, ptr %tmp1, i64 0, i32 1
+ %tmp1688 = load i32, ptr %tmp1683, align 4
%tmp1693 = shl i32 %tmp1688, 5
%tmp1694 = xor i32 %tmp1693, %tmp1688
%tmp1695 = lshr i32 %tmp1694, 7
@@ -36,10 +35,10 @@ define i32 @_Z16vector3util_mainv(i32 %x, i32 %y) {
%tmp1738 = xor i32 %tmp1737, %tmp1736
%tmp1739 = shl i32 %tmp1738, 22
%tmp1740 = xor i32 %tmp1739, %tmp1738
- store i32 %tmp1740, i32* %tmp1683, align 4
-; CHECK: store i32 310393545, i32* %tmp114, align 4
- %tmp1756 = getelementptr inbounds %2, %2* %tmp1, i64 0, i32 1
- %tmp1761 = load i32, i32* %tmp1756, align 4
+ store i32 %tmp1740, ptr %tmp1683, align 4
+; CHECK: store i32 310393545, ptr %tmp114, align 4
+ %tmp1756 = getelementptr inbounds %2, ptr %tmp1, i64 0, i32 1
+ %tmp1761 = load i32, ptr %tmp1756, align 4
%tmp1766 = shl i32 %tmp1761, 5
%tmp1767 = xor i32 %tmp1766, %tmp1761
%tmp1768 = lshr i32 %tmp1767, 7
@@ -64,10 +63,10 @@ define i32 @_Z16vector3util_mainv(i32 %x, i32 %y) {
%tmp1811 = xor i32 %tmp1810, %tmp1809
%tmp1812 = shl i32 %tmp1811, 22
%tmp1813 = xor i32 %tmp1812, %tmp1811
- store i32 %tmp1813, i32* %tmp1756, align 4
-; CHECK: store i32 -383584258, i32* %tmp114, align 4
- %tmp2645 = getelementptr inbounds %2, %2* %tmp1, i64 0, i32 1
- %tmp2650 = load i32, i32* %tmp2645, align 4
+ store i32 %tmp1813, ptr %tmp1756, align 4
+; CHECK: store i32 -383584258, ptr %tmp114, align 4
+ %tmp2645 = getelementptr inbounds %2, ptr %tmp1, i64 0, i32 1
+ %tmp2650 = load i32, ptr %tmp2645, align 4
%tmp2655 = shl i32 %tmp2650, 5
%tmp2656 = xor i32 %tmp2655, %tmp2650
%tmp2657 = lshr i32 %tmp2656, 7
@@ -92,7 +91,7 @@ define i32 @_Z16vector3util_mainv(i32 %x, i32 %y) {
%tmp2700 = xor i32 %tmp2699, %tmp2698
%tmp2701 = shl i32 %tmp2700, 22
%tmp2702 = xor i32 %tmp2701, %tmp2700
- store i32 %tmp2702, i32* %tmp2645, align 4
-; CHECK: store i32 -57163022, i32* %tmp114, align 4
+ store i32 %tmp2702, ptr %tmp2645, align 4
+; CHECK: store i32 -57163022, ptr %tmp114, align 4
ret i32 0
}
diff --git a/llvm/test/Transforms/NewGVN/funclet.ll b/llvm/test/Transforms/NewGVN/funclet.ll
index 951380ec08fa..3df3f940ec2d 100644
--- a/llvm/test/Transforms/NewGVN/funclet.ll
+++ b/llvm/test/Transforms/NewGVN/funclet.ll
@@ -2,31 +2,31 @@
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686-pc-windows-msvc"
-%eh.ThrowInfo = type { i32, i8*, i8*, i8* }
-%struct.A = type { i32* }
+%eh.ThrowInfo = type { i32, ptr, ptr, ptr }
+%struct.A = type { ptr }
@"_TI1?AUA@@" = external constant %eh.ThrowInfo
-define i8 @f() personality i32 (...)* @__CxxFrameHandler3 {
+define i8 @f() personality ptr @__CxxFrameHandler3 {
entry:
%b = alloca i8
%c = alloca i8
- store i8 42, i8* %b
- store i8 13, i8* %c
- invoke void @_CxxThrowException(i8* %b, %eh.ThrowInfo* nonnull @"_TI1?AUA@@")
+ store i8 42, ptr %b
+ store i8 13, ptr %c
+ invoke void @_CxxThrowException(ptr %b, ptr nonnull @"_TI1?AUA@@")
to label %unreachable unwind label %catch.dispatch
catch.dispatch: ; preds = %entry
%cs1 = catchswitch within none [label %catch] unwind to caller
catch: ; preds = %catch.dispatch
- %catchpad = catchpad within %cs1 [i8* null, i32 64, i8* null]
- store i8 5, i8* %b
+ %catchpad = catchpad within %cs1 [ptr null, i32 64, ptr null]
+ store i8 5, ptr %b
catchret from %catchpad to label %try.cont
try.cont: ; preds = %catch
- %load_b = load i8, i8* %b
- %load_c = load i8, i8* %c
+ %load_b = load i8, ptr %b
+ %load_c = load i8, ptr %c
%add = add i8 %load_b, %load_c
ret i8 %add
@@ -34,11 +34,11 @@ unreachable: ; preds = %entry
unreachable
}
; CHECK-LABEL: define i8 @f(
-; CHECK: %[[load_b:.*]] = load i8, i8* %b
-; CHECK-NEXT: %[[load_c:.*]] = load i8, i8* %c
+; CHECK: %[[load_b:.*]] = load i8, ptr %b
+; CHECK-NEXT: %[[load_c:.*]] = load i8, ptr %c
; CHECK-NEXT: %[[add:.*]] = add i8 %[[load_b]], %[[load_c]]
; CHECK-NEXT: ret i8 %[[add]]
declare i32 @__CxxFrameHandler3(...)
-declare x86_stdcallcc void @_CxxThrowException(i8*, %eh.ThrowInfo*)
+declare x86_stdcallcc void @_CxxThrowException(ptr, ptr)
diff --git a/llvm/test/Transforms/NewGVN/int_sideeffect.ll b/llvm/test/Transforms/NewGVN/int_sideeffect.ll
index 853080930752..f715d022ba01 100644
--- a/llvm/test/Transforms/NewGVN/int_sideeffect.ll
+++ b/llvm/test/Transforms/NewGVN/int_sideeffect.ll
@@ -6,10 +6,10 @@ declare void @llvm.sideeffect()
; CHECK-LABEL: s2l
; CHECK-NOT: load
-define float @s2l(float* %p) {
- store float 0.0, float* %p
+define float @s2l(ptr %p) {
+ store float 0.0, ptr %p
call void @llvm.sideeffect()
- %t = load float, float* %p
+ %t = load float, ptr %p
ret float %t
}
@@ -18,10 +18,10 @@ define float @s2l(float* %p) {
; CHECK-LABEL: rle
; CHECK: load
; CHECK-NOT: load
-define float @rle(float* %p) {
- %r = load float, float* %p
+define float @rle(ptr %p) {
+ %r = load float, ptr %p
call void @llvm.sideeffect()
- %s = load float, float* %p
+ %s = load float, ptr %p
%t = fadd float %r, %s
ret float %t
}
diff --git a/llvm/test/Transforms/NewGVN/invariant.group.ll b/llvm/test/Transforms/NewGVN/invariant.group.ll
index 772c1c66bec2..81e733f84ddb 100644
--- a/llvm/test/Transforms/NewGVN/invariant.group.ll
+++ b/llvm/test/Transforms/NewGVN/invariant.group.ll
@@ -1,8 +1,8 @@
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
-%struct.A = type { i32 (...)** }
- at _ZTV1A = available_externally unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast (i8** @_ZTI1A to i8*), i8* bitcast (void (%struct.A*)* @_ZN1A3fooEv to i8*)], align 8
- at _ZTI1A = external constant i8*
+%struct.A = type { ptr }
+ at _ZTV1A = available_externally unnamed_addr constant [3 x ptr] [ptr null, ptr @_ZTI1A, ptr @_ZN1A3fooEv], align 8
+ at _ZTI1A = external constant ptr
@unknownPtr = external global i8
@@ -10,12 +10,12 @@
define i8 @simple() {
entry:
%ptr = alloca i8
- store i8 42, i8* %ptr, !invariant.group !0
- call void @foo(i8* %ptr)
+ store i8 42, ptr %ptr, !invariant.group !0
+ call void @foo(ptr %ptr)
- %a = load i8, i8* %ptr, !invariant.group !0
- %b = load i8, i8* %ptr, !invariant.group !0
- %c = load i8, i8* %ptr, !invariant.group !0
+ %a = load i8, ptr %ptr, !invariant.group !0
+ %b = load i8, ptr %ptr, !invariant.group !0
+ %c = load i8, ptr %ptr, !invariant.group !0
; CHECK: ret i8 42
ret i8 %a
}
@@ -24,11 +24,11 @@ entry:
define i8 @optimizable1() {
entry:
%ptr = alloca i8
- store i8 42, i8* %ptr, !invariant.group !0
- %ptr2 = call i8* @llvm.launder.invariant.group.p0i8(i8* %ptr)
- %a = load i8, i8* %ptr, !invariant.group !0
+ store i8 42, ptr %ptr, !invariant.group !0
+ %ptr2 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr)
+ %a = load i8, ptr %ptr, !invariant.group !0
- call void @foo(i8* %ptr2); call to use %ptr2
+ call void @foo(ptr %ptr2); call to use %ptr2
; CHECK: ret i8 42
ret i8 %a
}
@@ -37,26 +37,26 @@ entry:
define i8 @optimizable2() {
entry:
%ptr = alloca i8
- store i8 42, i8* %ptr, !invariant.group !0
- call void @foo(i8* %ptr)
+ store i8 42, ptr %ptr, !invariant.group !0
+ call void @foo(ptr %ptr)
- store i8 13, i8* %ptr ; can't use this store with invariant.group
- %a = load i8, i8* %ptr
+ store i8 13, ptr %ptr ; can't use this store with invariant.group
+ %a = load i8, ptr %ptr
call void @bar(i8 %a) ; call to use %a
- call void @foo(i8* %ptr)
- %b = load i8, i8* %ptr, !invariant.group !0
+ call void @foo(ptr %ptr)
+ %b = load i8, ptr %ptr, !invariant.group !0
; CHECK: ret i8 42
ret i8 %b
}
; CHECK-LABEL: define i1 @proveEqualityForStrip(
-define i1 @proveEqualityForStrip(i8* %a) {
- %b1 = call i8* @llvm.strip.invariant.group.p0i8(i8* %a)
+define i1 @proveEqualityForStrip(ptr %a) {
+ %b1 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
; CHECK-NOT: llvm.strip.invariant.group
- %b2 = call i8* @llvm.strip.invariant.group.p0i8(i8* %a)
- %r = icmp eq i8* %b1, %b2
+ %b2 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
+ %r = icmp eq ptr %b1, %b2
; CHECK: ret i1 true
ret i1 %r
}
@@ -65,9 +65,9 @@ define i1 @proveEqualityForStrip(i8* %a) {
define i8 @unoptimizable1() {
entry:
%ptr = alloca i8
- store i8 42, i8* %ptr
- call void @foo(i8* %ptr)
- %a = load i8, i8* %ptr, !invariant.group !0
+ store i8 42, ptr %ptr
+ call void @foo(ptr %ptr)
+ %a = load i8, ptr %ptr, !invariant.group !0
; CHECK: ret i8 %a
ret i8 %a
}
@@ -76,52 +76,41 @@ entry:
; CHECK-LABEL: define void @indirectLoads() {
define void @indirectLoads() {
entry:
- %a = alloca %struct.A*, align 8
- %0 = bitcast %struct.A** %a to i8*
+ %a = alloca ptr, align 8
- %call = call i8* @getPointer(i8* null)
- %1 = bitcast i8* %call to %struct.A*
- call void @_ZN1AC1Ev(%struct.A* %1)
- %2 = bitcast %struct.A* %1 to i8***
+ %call = call ptr @getPointer(ptr null)
+ call void @_ZN1AC1Ev(ptr %call)
; CHECK: %vtable = load {{.*}} !invariant.group
- %vtable = load i8**, i8*** %2, align 8, !invariant.group !0
- %cmp.vtables = icmp eq i8** %vtable, getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1A, i64 0, i64 2)
+ %vtable = load ptr, ptr %call, align 8, !invariant.group !0
+ %cmp.vtables = icmp eq ptr %vtable, getelementptr inbounds ([3 x ptr], ptr @_ZTV1A, i64 0, i64 2)
call void @llvm.assume(i1 %cmp.vtables)
- store %struct.A* %1, %struct.A** %a, align 8
- %3 = load %struct.A*, %struct.A** %a, align 8
- %4 = bitcast %struct.A* %3 to void (%struct.A*)***
+ store ptr %call, ptr %a, align 8
+ %0 = load ptr, ptr %a, align 8
; FIXME: call void @_ZN1A3fooEv(
- %vtable1 = load void (%struct.A*)**, void (%struct.A*)*** %4, align 8, !invariant.group !0
- %vfn = getelementptr inbounds void (%struct.A*)*, void (%struct.A*)** %vtable1, i64 0
- %5 = load void (%struct.A*)*, void (%struct.A*)** %vfn, align 8
- call void %5(%struct.A* %3)
- %6 = load %struct.A*, %struct.A** %a, align 8
- %7 = bitcast %struct.A* %6 to void (%struct.A*)***
+ %vtable1 = load ptr, ptr %0, align 8, !invariant.group !0
+ %1 = load ptr, ptr %vtable1, align 8
+ call void %1(ptr %0)
+ %2 = load ptr, ptr %a, align 8
; FIXME: call void @_ZN1A3fooEv(
- %vtable2 = load void (%struct.A*)**, void (%struct.A*)*** %7, align 8, !invariant.group !0
- %vfn3 = getelementptr inbounds void (%struct.A*)*, void (%struct.A*)** %vtable2, i64 0
- %8 = load void (%struct.A*)*, void (%struct.A*)** %vfn3, align 8
+ %vtable2 = load ptr, ptr %2, align 8, !invariant.group !0
+ %3 = load ptr, ptr %vtable2, align 8
- call void %8(%struct.A* %6)
- %9 = load %struct.A*, %struct.A** %a, align 8
- %10 = bitcast %struct.A* %9 to void (%struct.A*)***
+ call void %3(ptr %2)
+ %4 = load ptr, ptr %a, align 8
- %vtable4 = load void (%struct.A*)**, void (%struct.A*)*** %10, align 8, !invariant.group !0
- %vfn5 = getelementptr inbounds void (%struct.A*)*, void (%struct.A*)** %vtable4, i64 0
- %11 = load void (%struct.A*)*, void (%struct.A*)** %vfn5, align 8
+ %vtable4 = load ptr, ptr %4, align 8, !invariant.group !0
+ %5 = load ptr, ptr %vtable4, align 8
; FIXME: call void @_ZN1A3fooEv(
- call void %11(%struct.A* %9)
+ call void %5(ptr %4)
- %vtable5 = load i8**, i8*** %2, align 8, !invariant.group !0
- %vfn6 = getelementptr inbounds i8*, i8** %vtable5, i64 0
- %12 = bitcast i8** %vfn6 to void (%struct.A*)**
- %13 = load void (%struct.A*)*, void (%struct.A*)** %12, align 8
+ %vtable5 = load ptr, ptr %call, align 8, !invariant.group !0
+ %6 = load ptr, ptr %vtable5, align 8
; FIXME: call void @_ZN1A3fooEv(
- call void %13(%struct.A* %9)
+ call void %6(ptr %4)
ret void
}
@@ -130,27 +119,22 @@ entry:
; CHECK-LABEL: define void @combiningBitCastWithLoad() {
define void @combiningBitCastWithLoad() {
entry:
- %a = alloca %struct.A*, align 8
- %0 = bitcast %struct.A** %a to i8*
+ %a = alloca ptr, align 8
- %call = call i8* @getPointer(i8* null)
- %1 = bitcast i8* %call to %struct.A*
- call void @_ZN1AC1Ev(%struct.A* %1)
- %2 = bitcast %struct.A* %1 to i8***
+ %call = call ptr @getPointer(ptr null)
+ call void @_ZN1AC1Ev(ptr %call)
; CHECK: %vtable = load {{.*}} !invariant.group
- %vtable = load i8**, i8*** %2, align 8, !invariant.group !0
- %cmp.vtables = icmp eq i8** %vtable, getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1A, i64 0, i64 2)
+ %vtable = load ptr, ptr %call, align 8, !invariant.group !0
+ %cmp.vtables = icmp eq ptr %vtable, getelementptr inbounds ([3 x ptr], ptr @_ZTV1A, i64 0, i64 2)
- store %struct.A* %1, %struct.A** %a, align 8
+ store ptr %call, ptr %a, align 8
; FIXME-NOT: !invariant.group
- %3 = load %struct.A*, %struct.A** %a, align 8
- %4 = bitcast %struct.A* %3 to void (%struct.A*)***
+ %0 = load ptr, ptr %a, align 8
- %vtable1 = load void (%struct.A*)**, void (%struct.A*)*** %4, align 8, !invariant.group !0
- %vfn = getelementptr inbounds void (%struct.A*)*, void (%struct.A*)** %vtable1, i64 0
- %5 = load void (%struct.A*)*, void (%struct.A*)** %vfn, align 8
- call void %5(%struct.A* %3)
+ %vtable1 = load ptr, ptr %0, align 8, !invariant.group !0
+ %1 = load ptr, ptr %vtable1, align 8
+ call void %1(ptr %0)
ret void
}
@@ -159,12 +143,12 @@ entry:
define void @loadCombine() {
enter:
%ptr = alloca i8
- store i8 42, i8* %ptr
- call void @foo(i8* %ptr)
-; CHECK: %[[A:.*]] = load i8, i8* %ptr, align 1, !invariant.group
- %a = load i8, i8* %ptr, !invariant.group !0
+ store i8 42, ptr %ptr
+ call void @foo(ptr %ptr)
+; CHECK: %[[A:.*]] = load i8, ptr %ptr, align 1, !invariant.group
+ %a = load i8, ptr %ptr, !invariant.group !0
; CHECK-NOT: load
- %b = load i8, i8* %ptr, !invariant.group !0
+ %b = load i8, ptr %ptr, !invariant.group !0
; CHECK: call void @bar(i8 %[[A]])
call void @bar(i8 %a)
; CHECK: call void @bar(i8 %[[A]])
@@ -176,12 +160,12 @@ enter:
define void @loadCombine1() {
enter:
%ptr = alloca i8
- store i8 42, i8* %ptr
- call void @foo(i8* %ptr)
-; CHECK: %[[D:.*]] = load i8, i8* %ptr, align 1, !invariant.group
- %c = load i8, i8* %ptr
+ store i8 42, ptr %ptr
+ call void @foo(ptr %ptr)
+; CHECK: %[[D:.*]] = load i8, ptr %ptr, align 1, !invariant.group
+ %c = load i8, ptr %ptr
; CHECK-NOT: load
- %d = load i8, i8* %ptr, !invariant.group !0
+ %d = load i8, ptr %ptr, !invariant.group !0
; CHECK: call void @bar(i8 %[[D]])
call void @bar(i8 %c)
; CHECK: call void @bar(i8 %[[D]])
@@ -193,12 +177,12 @@ enter:
define void @loadCombine2() {
enter:
%ptr = alloca i8
- store i8 42, i8* %ptr
- call void @foo(i8* %ptr)
-; CHECK: %[[E:.*]] = load i8, i8* %ptr, align 1, !invariant.group
- %e = load i8, i8* %ptr, !invariant.group !0
+ store i8 42, ptr %ptr
+ call void @foo(ptr %ptr)
+; CHECK: %[[E:.*]] = load i8, ptr %ptr, align 1, !invariant.group
+ %e = load i8, ptr %ptr, !invariant.group !0
; CHECK-NOT: load
- %f = load i8, i8* %ptr
+ %f = load i8, ptr %ptr
; CHECK: call void @bar(i8 %[[E]])
call void @bar(i8 %e)
; CHECK: call void @bar(i8 %[[E]])
@@ -210,12 +194,12 @@ enter:
define void @loadCombine3() {
enter:
%ptr = alloca i8
- store i8 42, i8* %ptr
- call void @foo(i8* %ptr)
-; CHECK: %[[E:.*]] = load i8, i8* %ptr, align 1, !invariant.group
- %e = load i8, i8* %ptr, !invariant.group !0
+ store i8 42, ptr %ptr
+ call void @foo(ptr %ptr)
+; CHECK: %[[E:.*]] = load i8, ptr %ptr, align 1, !invariant.group
+ %e = load i8, ptr %ptr, !invariant.group !0
; CHECK-NOT: load
- %f = load i8, i8* %ptr, !invariant.group !0
+ %f = load i8, ptr %ptr, !invariant.group !0
; CHECK: call void @bar(i8 %[[E]])
call void @bar(i8 %e)
; CHECK: call void @bar(i8 %[[E]])
@@ -227,11 +211,11 @@ enter:
define i8 @unoptimizable2() {
entry:
%ptr = alloca i8
- store i8 42, i8* %ptr
- call void @foo(i8* %ptr)
- %a = load i8, i8* %ptr
- call void @foo(i8* %ptr)
- %b = load i8, i8* %ptr, !invariant.group !0
+ store i8 42, ptr %ptr
+ call void @foo(ptr %ptr)
+ %a = load i8, ptr %ptr
+ call void @foo(ptr %ptr)
+ %b = load i8, ptr %ptr, !invariant.group !0
; CHECK: ret i8 %a
ret i8 %a
@@ -241,9 +225,9 @@ entry:
define i8 @unoptimizable3() {
entry:
%ptr = alloca i8
- store i8 42, i8* %ptr, !invariant.group !0
- %ptr2 = call i8* @getPointer(i8* %ptr)
- %a = load i8, i8* %ptr2, !invariant.group !0
+ store i8 42, ptr %ptr, !invariant.group !0
+ %ptr2 = call ptr @getPointer(ptr %ptr)
+ %a = load i8, ptr %ptr2, !invariant.group !0
; CHECK: ret i8 %a
ret i8 %a
@@ -254,10 +238,10 @@ entry:
define i8 @optimizable4() {
entry:
%ptr = alloca i8
- store i8 42, i8* %ptr
- %ptr2 = call i8* @llvm.launder.invariant.group.p0i8(i8* %ptr)
+ store i8 42, ptr %ptr
+ %ptr2 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr)
; FIXME-NOT: load
- %a = load i8, i8* %ptr2
+ %a = load i8, ptr %ptr2
; FIXME: ret i8 42
ret i8 %a
@@ -267,14 +251,14 @@ entry:
define i8 @volatile1() {
entry:
%ptr = alloca i8
- store i8 42, i8* %ptr, !invariant.group !0
- call void @foo(i8* %ptr)
- %a = load i8, i8* %ptr, !invariant.group !0
- %b = load volatile i8, i8* %ptr
+ store i8 42, ptr %ptr, !invariant.group !0
+ call void @foo(ptr %ptr)
+ %a = load i8, ptr %ptr, !invariant.group !0
+ %b = load volatile i8, ptr %ptr
; CHECK: call void @bar(i8 %b)
call void @bar(i8 %b)
- %c = load volatile i8, i8* %ptr, !invariant.group !0
+ %c = load volatile i8, ptr %ptr, !invariant.group !0
; We might be able to optimize this, but nobody cares
; CHECK: call void @bar(i8 %c)
call void @bar(i8 %c)
@@ -286,14 +270,14 @@ entry:
define i8 @volatile2() {
entry:
%ptr = alloca i8
- store i8 42, i8* %ptr, !invariant.group !0
- call void @foo(i8* %ptr)
- %a = load i8, i8* %ptr, !invariant.group !0
- %b = load volatile i8, i8* %ptr
+ store i8 42, ptr %ptr, !invariant.group !0
+ call void @foo(ptr %ptr)
+ %a = load i8, ptr %ptr, !invariant.group !0
+ %b = load volatile i8, ptr %ptr
; CHECK: call void @bar(i8 %b)
call void @bar(i8 %b)
- %c = load volatile i8, i8* %ptr, !invariant.group !0
+ %c = load volatile i8, ptr %ptr, !invariant.group !0
; We might be able to optimize this, but nobody cares
; CHECK: call void @bar(i8 %c)
call void @bar(i8 %c)
@@ -305,10 +289,10 @@ entry:
define void @fun() {
entry:
%ptr = alloca i8
- store i8 42, i8* %ptr, !invariant.group !0
- call void @foo(i8* %ptr)
+ store i8 42, ptr %ptr, !invariant.group !0
+ call void @foo(ptr %ptr)
- %a = load i8, i8* %ptr, !invariant.group !0 ; Can assume that value under %ptr didn't change
+ %a = load i8, ptr %ptr, !invariant.group !0 ; Can assume that value under %ptr didn't change
; CHECK: call void @bar(i8 42)
call void @bar(i8 %a)
@@ -320,24 +304,21 @@ entry:
; CHECK-LABEL: define void @testGEP0() {
define void @testGEP0() {
%a = alloca %struct.A, align 8
- %1 = bitcast %struct.A* %a to i8*
- %2 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 0
- store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1A, i64 0, i64 2) to i32 (...)**), i32 (...)*** %2, align 8, !invariant.group !0
-; CHECK: call void @_ZN1A3fooEv(%struct.A* nonnull dereferenceable(8) %a)
- call void @_ZN1A3fooEv(%struct.A* nonnull dereferenceable(8) %a) ; This call may change vptr
- %3 = load i8, i8* @unknownPtr, align 4
- %4 = icmp eq i8 %3, 0
- br i1 %4, label %_Z1gR1A.exit, label %5
+ store ptr getelementptr inbounds ([3 x ptr], ptr @_ZTV1A, i64 0, i64 2), ptr %a, align 8, !invariant.group !0
+; CHECK: call void @_ZN1A3fooEv(ptr nonnull dereferenceable(8) %a)
+ call void @_ZN1A3fooEv(ptr nonnull dereferenceable(8) %a) ; This call may change vptr
+ %1 = load i8, ptr @unknownPtr, align 4
+ %2 = icmp eq i8 %1, 0
+ br i1 %2, label %_Z1gR1A.exit, label %3
; This should be devirtualized by invariant.group
- %6 = bitcast %struct.A* %a to void (%struct.A*)***
- %7 = load void (%struct.A*)**, void (%struct.A*)*** %6, align 8, !invariant.group !0
- %8 = load void (%struct.A*)*, void (%struct.A*)** %7, align 8
-; FIXME: call void @_ZN1A3fooEv(%struct.A* nonnull %a)
- call void %8(%struct.A* nonnull %a)
+ %4 = load ptr, ptr %a, align 8, !invariant.group !0
+ %5 = load ptr, ptr %4, align 8
+; FIXME: call void @_ZN1A3fooEv(ptr nonnull %a)
+ call void %5(ptr nonnull %a)
br label %_Z1gR1A.exit
-_Z1gR1A.exit: ; preds = %0, %5
+_Z1gR1A.exit: ; preds = %0, %3
ret void
}
@@ -346,22 +327,21 @@ _Z1gR1A.exit: ; preds = %0, %5
; from the same function.
; CHECK-LABEL: define void @testGlobal() {
define void @testGlobal() {
-; CHECK: %a = load i8, i8* @unknownPtr, align 1, !invariant.group !0
- %a = load i8, i8* @unknownPtr, !invariant.group !0
- call void @foo2(i8* @unknownPtr, i8 %a)
-; CHECK: %1 = load i8, i8* @unknownPtr, align 1, !invariant.group !0
- %1 = load i8, i8* @unknownPtr, !invariant.group !0
+; CHECK: %a = load i8, ptr @unknownPtr, align 1, !invariant.group !0
+ %a = load i8, ptr @unknownPtr, !invariant.group !0
+ call void @foo2(ptr @unknownPtr, i8 %a)
+; CHECK: %1 = load i8, ptr @unknownPtr, align 1, !invariant.group !0
+ %1 = load i8, ptr @unknownPtr, !invariant.group !0
call void @bar(i8 %1)
- %b0 = bitcast i8* @unknownPtr to i1*
- call void @fooBit(i1* %b0, i1 1)
+ call void @fooBit(ptr @unknownPtr, i1 1)
; Adding regex because of canonicalization of bitcasts
-; CHECK: %2 = load i1, i1* {{.*}}, !invariant.group !0
- %2 = load i1, i1* %b0, !invariant.group !0
- call void @fooBit(i1* %b0, i1 %2)
-; CHECK: %3 = load i1, i1* {{.*}}, !invariant.group !0
- %3 = load i1, i1* %b0, !invariant.group !0
- call void @fooBit(i1* %b0, i1 %3)
+; CHECK: %2 = load i1, ptr {{.*}}, !invariant.group !0
+ %2 = load i1, ptr @unknownPtr, !invariant.group !0
+ call void @fooBit(ptr @unknownPtr, i1 %2)
+; CHECK: %3 = load i1, ptr {{.*}}, !invariant.group !0
+ %3 = load i1, ptr @unknownPtr, !invariant.group !0
+ call void @fooBit(ptr @unknownPtr, i1 %3)
ret void
}
@@ -370,24 +350,23 @@ define void @testGlobal() {
; CHECK-LABEL: define void @testTrunc() {
define void @testTrunc() {
%a = alloca i8
- call void @foo(i8* %a)
-; CHECK: %b = load i8, i8* %a, align 1, !invariant.group !0
- %b = load i8, i8* %a, !invariant.group !0
- call void @foo2(i8* %a, i8 %b)
+ call void @foo(ptr %a)
+; CHECK: %b = load i8, ptr %a, align 1, !invariant.group !0
+ %b = load i8, ptr %a, !invariant.group !0
+ call void @foo2(ptr %a, i8 %b)
- %1 = load i8, i8* %a, !invariant.group !0
+ %1 = load i8, ptr %a, !invariant.group !0
; CHECK: call void @bar(i8 %b)
call void @bar(i8 %1)
- %b0 = bitcast i8* %a to i1*
- call void @fooBit(i1* %b0, i1 1)
+ call void @fooBit(ptr %a, i1 1)
; FIXME: %1 = trunc i8 %b to i1
- %2 = load i1, i1* %b0, !invariant.group !0
-; FIXME-NEXT: call void @fooBit(i1* %b0, i1 %1)
- call void @fooBit(i1* %b0, i1 %2)
- %3 = load i1, i1* %b0, !invariant.group !0
-; FIXME-NEXT: call void @fooBit(i1* %b0, i1 %1)
- call void @fooBit(i1* %b0, i1 %3)
+ %2 = load i1, ptr %a, !invariant.group !0
+; FIXME-NEXT: call void @fooBit(ptr %a, i1 %1)
+ call void @fooBit(ptr %a, i1 %2)
+ %3 = load i1, ptr %a, !invariant.group !0
+; FIXME-NEXT: call void @fooBit(ptr %a, i1 %1)
+ call void @fooBit(ptr %a, i1 %3)
ret void
}
@@ -395,33 +374,30 @@ define void @testTrunc() {
; CHECK-LABEL: define void @handling_loops()
define void @handling_loops() {
%a = alloca %struct.A, align 8
- %1 = bitcast %struct.A* %a to i8*
- %2 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 0
- store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1A, i64 0, i64 2) to i32 (...)**), i32 (...)*** %2, align 8, !invariant.group !0
- %3 = load i8, i8* @unknownPtr, align 4
- %4 = icmp sgt i8 %3, 0
- br i1 %4, label %.lr.ph.i, label %_Z2g2R1A.exit
+ store ptr getelementptr inbounds ([3 x ptr], ptr @_ZTV1A, i64 0, i64 2), ptr %a, align 8, !invariant.group !0
+ %1 = load i8, ptr @unknownPtr, align 4
+ %2 = icmp sgt i8 %1, 0
+ br i1 %2, label %.lr.ph.i, label %_Z2g2R1A.exit
.lr.ph.i: ; preds = %0
- %5 = bitcast %struct.A* %a to void (%struct.A*)***
- %6 = load i8, i8* @unknownPtr, align 4
- %7 = icmp sgt i8 %6, 1
- br i1 %7, label %._crit_edge.preheader, label %_Z2g2R1A.exit
+ %3 = load i8, ptr @unknownPtr, align 4
+ %4 = icmp sgt i8 %3, 1
+ br i1 %4, label %._crit_edge.preheader, label %_Z2g2R1A.exit
._crit_edge.preheader: ; preds = %.lr.ph.i
br label %._crit_edge
._crit_edge: ; preds = %._crit_edge.preheader, %._crit_edge
- %8 = phi i8 [ %10, %._crit_edge ], [ 1, %._crit_edge.preheader ]
- %.pre = load void (%struct.A*)**, void (%struct.A*)*** %5, align 8, !invariant.group !0
- %9 = load void (%struct.A*)*, void (%struct.A*)** %.pre, align 8
- ; FIXME: call void @_ZN1A3fooEv(%struct.A* nonnull %a)
- call void %9(%struct.A* nonnull %a) #3
+ %5 = phi i8 [ %7, %._crit_edge ], [ 1, %._crit_edge.preheader ]
+ %.pre = load ptr, ptr %a, align 8, !invariant.group !0
+ %6 = load ptr, ptr %.pre, align 8
+ ; FIXME: call void @_ZN1A3fooEv(ptr nonnull %a)
+ call void %6(ptr nonnull %a) #3
; FIXME-NOT: call void %
- %10 = add nuw nsw i8 %8, 1
- %11 = load i8, i8* @unknownPtr, align 4
- %12 = icmp slt i8 %10, %11
- br i1 %12, label %._crit_edge, label %_Z2g2R1A.exit.loopexit
+ %7 = add nuw nsw i8 %5, 1
+ %8 = load i8, ptr @unknownPtr, align 4
+ %9 = icmp slt i8 %7, %8
+ br i1 %9, label %._crit_edge, label %_Z2g2R1A.exit.loopexit
_Z2g2R1A.exit.loopexit: ; preds = %._crit_edge
br label %_Z2g2R1A.exit
@@ -431,16 +407,16 @@ _Z2g2R1A.exit: ; preds = %_Z2g2R1A.exit.loope
}
-declare void @foo(i8*)
-declare void @foo2(i8*, i8)
+declare void @foo(ptr)
+declare void @foo2(ptr, i8)
declare void @bar(i8)
-declare i8* @getPointer(i8*)
-declare void @_ZN1A3fooEv(%struct.A*)
-declare void @_ZN1AC1Ev(%struct.A*)
-declare void @fooBit(i1*, i1)
+declare ptr @getPointer(ptr)
+declare void @_ZN1A3fooEv(ptr)
+declare void @_ZN1AC1Ev(ptr)
+declare void @fooBit(ptr, i1)
-declare i8* @llvm.launder.invariant.group.p0i8(i8*)
-declare i8* @llvm.strip.invariant.group.p0i8(i8*)
+declare ptr @llvm.launder.invariant.group.p0(ptr)
+declare ptr @llvm.strip.invariant.group.p0(ptr)
; Function Attrs: nounwind
declare void @llvm.assume(i1 %cmp.vtables) #0
diff --git a/llvm/test/Transforms/NewGVN/invariant.start.ll b/llvm/test/Transforms/NewGVN/invariant.start.ll
index b477b6ea2b45..100b79fd3bff 100644
--- a/llvm/test/Transforms/NewGVN/invariant.start.ll
+++ b/llvm/test/Transforms/NewGVN/invariant.start.ll
@@ -2,58 +2,58 @@
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
-declare {}* @llvm.invariant.start.p0i8(i64, i8* nocapture) nounwind readonly
-declare void @llvm.invariant.end.p0i8({}*, i64, i8* nocapture) nounwind
+declare ptr @llvm.invariant.start.p0(i64, ptr nocapture) nounwind readonly
+declare void @llvm.invariant.end.p0(ptr, i64, ptr nocapture) nounwind
; We forward store to the load across the invariant.start intrinsic
define i8 @forward_store() {
; CHECK-LABEL: @forward_store
-; CHECK: call {}* @llvm.invariant.start.p0i8(i64 1, i8* %a)
+; CHECK: call ptr @llvm.invariant.start.p0(i64 1, ptr %a)
; CHECK-NOT: load
; CHECK: ret i8 0
%a = alloca i8
- store i8 0, i8* %a
- %i = call {}* @llvm.invariant.start.p0i8(i64 1, i8* %a)
- %r = load i8, i8* %a
+ store i8 0, ptr %a
+ %i = call ptr @llvm.invariant.start.p0(i64 1, ptr %a)
+ %r = load i8, ptr %a
ret i8 %r
}
-declare i8 @dummy(i8* nocapture) nounwind readonly
+declare i8 @dummy(ptr nocapture) nounwind readonly
; We forward store to the load in the non-local analysis case,
; i.e. invariant.start is in another basic block.
define i8 @forward_store_nonlocal(i1 %cond) {
; CHECK-LABEL: forward_store_nonlocal
-; CHECK: call {}* @llvm.invariant.start.p0i8(i64 1, i8* %a)
+; CHECK: call ptr @llvm.invariant.start.p0(i64 1, ptr %a)
; CHECK: ret i8 0
; CHECK: ret i8 %val
%a = alloca i8
- store i8 0, i8* %a
- %i = call {}* @llvm.invariant.start.p0i8(i64 1, i8* %a)
+ store i8 0, ptr %a
+ %i = call ptr @llvm.invariant.start.p0(i64 1, ptr %a)
br i1 %cond, label %loadblock, label %exit
loadblock:
- %r = load i8, i8* %a
+ %r = load i8, ptr %a
ret i8 %r
exit:
- %val = call i8 @dummy(i8* %a)
+ %val = call i8 @dummy(ptr %a)
ret i8 %val
}
; We should not value forward %foo to the invariant.end corresponding to %bar.
define i8 @forward_store1() {
; CHECK-LABEL: forward_store1
-; CHECK: %foo = call {}* @llvm.invariant.start.p0i8
+; CHECK: %foo = call ptr @llvm.invariant.start.p0
; CHECK-NOT: load
-; CHECK: %bar = call {}* @llvm.invariant.start.p0i8
-; CHECK: call void @llvm.invariant.end.p0i8({}* %bar, i64 1, i8* %a)
+; CHECK: %bar = call ptr @llvm.invariant.start.p0
+; CHECK: call void @llvm.invariant.end.p0(ptr %bar, i64 1, ptr %a)
; CHECK: ret i8 0
%a = alloca i8
- store i8 0, i8* %a
- %foo = call {}* @llvm.invariant.start.p0i8(i64 1, i8* %a)
- %r = load i8, i8* %a
- %bar = call {}* @llvm.invariant.start.p0i8(i64 1, i8* %a)
- call void @llvm.invariant.end.p0i8({}* %bar, i64 1, i8* %a)
+ store i8 0, ptr %a
+ %foo = call ptr @llvm.invariant.start.p0(i64 1, ptr %a)
+ %r = load i8, ptr %a
+ %bar = call ptr @llvm.invariant.start.p0(i64 1, ptr %a)
+ call void @llvm.invariant.end.p0(ptr %bar, i64 1, ptr %a)
ret i8 %r
}
diff --git a/llvm/test/Transforms/NewGVN/lifetime-simple.ll b/llvm/test/Transforms/NewGVN/lifetime-simple.ll
index 792d09bdaeac..5d31101218ee 100644
--- a/llvm/test/Transforms/NewGVN/lifetime-simple.ll
+++ b/llvm/test/Transforms/NewGVN/lifetime-simple.ll
@@ -3,18 +3,18 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin7"
-define i8 @test(i8* %P) nounwind {
+define i8 @test(ptr %P) nounwind {
; CHECK: lifetime.start
; CHECK-NOT: load
; CHECK: lifetime.end
entry:
- call void @llvm.lifetime.start.p0i8(i64 32, i8* %P)
- %0 = load i8, i8* %P
- store i8 1, i8* %P
- call void @llvm.lifetime.end.p0i8(i64 32, i8* %P)
- %1 = load i8, i8* %P
+ call void @llvm.lifetime.start.p0(i64 32, ptr %P)
+ %0 = load i8, ptr %P
+ store i8 1, ptr %P
+ call void @llvm.lifetime.end.p0(i64 32, ptr %P)
+ %1 = load i8, ptr %P
ret i8 %1
}
-declare void @llvm.lifetime.start.p0i8(i64 %S, i8* nocapture %P) readonly
-declare void @llvm.lifetime.end.p0i8(i64 %S, i8* nocapture %P)
+declare void @llvm.lifetime.start.p0(i64 %S, ptr nocapture %P) readonly
+declare void @llvm.lifetime.end.p0(i64 %S, ptr nocapture %P)
diff --git a/llvm/test/Transforms/NewGVN/load-constant-mem.ll b/llvm/test/Transforms/NewGVN/load-constant-mem.ll
index c21ea60eb12a..06439c59f9d2 100644
--- a/llvm/test/Transforms/NewGVN/load-constant-mem.ll
+++ b/llvm/test/Transforms/NewGVN/load-constant-mem.ll
@@ -3,18 +3,18 @@
; PR4189
@G = external constant [4 x i32]
-define i32 @test(i8* %p, i32 %i) nounwind {
+define i32 @test(ptr %p, i32 %i) nounwind {
; CHECK-LABEL: @test(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[P:%.*]] = getelementptr [4 x i32], [4 x i32]* @G, i32 0, i32 [[I:%.*]]
-; CHECK-NEXT: store i8 4, i8* [[P:%.*]]
+; CHECK-NEXT: [[P:%.*]] = getelementptr [4 x i32], ptr @G, i32 0, i32 [[I:%.*]]
+; CHECK-NEXT: store i8 4, ptr [[P:%.*]]
; CHECK-NEXT: ret i32 0
;
entry:
- %P = getelementptr [4 x i32], [4 x i32]* @G, i32 0, i32 %i
- %A = load i32, i32* %P
- store i8 4, i8* %p
- %B = load i32, i32* %P
+ %P = getelementptr [4 x i32], ptr @G, i32 0, i32 %i
+ %A = load i32, ptr %P
+ store i8 4, ptr %p
+ %B = load i32, ptr %P
%C = sub i32 %A, %B
ret i32 %C
}
diff --git a/llvm/test/Transforms/NewGVN/load-from-unreachable-predecessor.ll b/llvm/test/Transforms/NewGVN/load-from-unreachable-predecessor.ll
index 905779a545cb..74cb70066eb1 100644
--- a/llvm/test/Transforms/NewGVN/load-from-unreachable-predecessor.ll
+++ b/llvm/test/Transforms/NewGVN/load-from-unreachable-predecessor.ll
@@ -3,18 +3,18 @@
; Check that an unreachable predecessor to a PHI node doesn't cause a crash.
; PR21625.
-define i32 @f(i32** %f) {
+define i32 @f(ptr %f) {
; CHECK: bb0:
; Load should be removed, since it's ignored.
; CHECK-NEXT: br label
bb0:
- %bar = load i32*, i32** %f
+ %bar = load ptr, ptr %f
br label %bb2
bb1:
- %zed = load i32*, i32** %f
+ %zed = load ptr, ptr %f
br i1 false, label %bb1, label %bb2
bb2:
- %foo = phi i32* [ null, %bb0 ], [ %zed, %bb1 ]
- %storemerge = load i32, i32* %foo
+ %foo = phi ptr [ null, %bb0 ], [ %zed, %bb1 ]
+ %storemerge = load i32, ptr %foo
ret i32 %storemerge
}
diff --git a/llvm/test/Transforms/NewGVN/loadforward.ll b/llvm/test/Transforms/NewGVN/loadforward.ll
index 9e5bea8f2114..d8a9022dc66f 100644
--- a/llvm/test/Transforms/NewGVN/loadforward.ll
+++ b/llvm/test/Transforms/NewGVN/loadforward.ll
@@ -9,20 +9,18 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
;; Test that we forward the first store to the second load
define i16 @bazinga() {
; CHECK-LABEL: @bazinga(
-; CHECK-NEXT: [[_TMP10:%.*]] = load i16, i16* getelementptr inbounds (%rec11, %rec11* @str, i64 0, i32 1)
-; CHECK-NEXT: store i16 [[_TMP10]], i16* getelementptr inbounds (%rec11, %rec11* @str, i64 0, i32 0)
+; CHECK-NEXT: [[_TMP10:%.*]] = load i16, ptr getelementptr inbounds (%rec11, ptr @str, i64 0, i32 1)
+; CHECK-NEXT: store i16 [[_TMP10]], ptr @str
; CHECK-NEXT: [[_TMP15:%.*]] = icmp eq i16 [[_TMP10]], 3
; CHECK-NEXT: [[_TMP16:%.*]] = select i1 [[_TMP15]], i16 1, i16 0
; CHECK-NEXT: br label [[BB1:%.*]]
; CHECK: bb1:
; CHECK-NEXT: ret i16 [[_TMP16]]
;
- %_tmp9 = getelementptr %rec11, %rec11* @str, i16 0, i32 1
- %_tmp10 = load i16, i16* %_tmp9
- %_tmp12 = getelementptr %rec11, %rec11* @str, i16 0, i32 0
- store i16 %_tmp10, i16* %_tmp12
- %_tmp13 = getelementptr %rec11, %rec11* @str, i16 0, i32 0
- %_tmp14 = load i16, i16* %_tmp13
+ %_tmp9 = getelementptr %rec11, ptr @str, i16 0, i32 1
+ %_tmp10 = load i16, ptr %_tmp9
+ store i16 %_tmp10, ptr @str
+ %_tmp14 = load i16, ptr @str
%_tmp15 = icmp eq i16 %_tmp14, 3
%_tmp16 = select i1 %_tmp15, i16 1, i16 0
br label %bb1
diff --git a/llvm/test/Transforms/NewGVN/malloc-load-removal.ll b/llvm/test/Transforms/NewGVN/malloc-load-removal.ll
index 76aa2fe9ebe1..b487acfe93e4 100644
--- a/llvm/test/Transforms/NewGVN/malloc-load-removal.ll
+++ b/llvm/test/Transforms/NewGVN/malloc-load-removal.ll
@@ -4,63 +4,63 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.8.0"
-declare i8* @malloc(i64) nounwind allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc"
+declare ptr @malloc(i64) nounwind allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc"
-define noalias i8* @test1() nounwind uwtable ssp {
+define noalias ptr @test1() nounwind uwtable ssp {
entry:
- %call = tail call i8* @malloc(i64 100) nounwind
- %0 = load i8, i8* %call, align 1
+ %call = tail call ptr @malloc(i64 100) nounwind
+ %0 = load i8, ptr %call, align 1
%tobool = icmp eq i8 %0, 0
br i1 %tobool, label %if.end, label %if.then
if.then: ; preds = %entry
- store i8 0, i8* %call, align 1
+ store i8 0, ptr %call, align 1
br label %if.end
if.end: ; preds = %if.then, %entry
- ret i8* %call
+ ret ptr %call
; CHECK-LABEL: @test1(
; CHECK-NOT: load
; CHECK-NOT: icmp
}
-declare i8* @_Znwm(i64) nounwind
+declare ptr @_Znwm(i64) nounwind
-define noalias i8* @test2() nounwind uwtable ssp {
+define noalias ptr @test2() nounwind uwtable ssp {
entry:
- %call = tail call i8* @_Znwm(i64 100) nounwind
- %0 = load i8, i8* %call, align 1
+ %call = tail call ptr @_Znwm(i64 100) nounwind
+ %0 = load i8, ptr %call, align 1
%tobool = icmp eq i8 %0, 0
br i1 %tobool, label %if.end, label %if.then
if.then: ; preds = %entry
- store i8 0, i8* %call, align 1
+ store i8 0, ptr %call, align 1
br label %if.end
if.end: ; preds = %if.then, %entry
- ret i8* %call
+ ret ptr %call
; CHECK-LABEL: @test2(
; CHECK-NOT: load
; CHECK-NOT: icmp
}
-declare i8* @aligned_alloc(i64 allocalign, i64) nounwind allockind("alloc,uninitialized,aligned") allocsize(1) "alloc-family"="malloc"
+declare ptr @aligned_alloc(i64 allocalign, i64) nounwind allockind("alloc,uninitialized,aligned") allocsize(1) "alloc-family"="malloc"
-define noalias i8* @test3() nounwind uwtable ssp {
+define noalias ptr @test3() nounwind uwtable ssp {
entry:
- %call = tail call i8* @aligned_alloc(i64 256, i64 32) nounwind
- %0 = load i8, i8* %call, align 32
+ %call = tail call ptr @aligned_alloc(i64 256, i64 32) nounwind
+ %0 = load i8, ptr %call, align 32
%tobool = icmp eq i8 %0, 0
br i1 %tobool, label %if.end, label %if.then
if.then: ; preds = %entry
- store i8 0, i8* %call, align 1
+ store i8 0, ptr %call, align 1
br label %if.end
if.end: ; preds = %if.then, %entry
- ret i8* %call
+ ret ptr %call
; CHECK-LABEL: @test3(
; CHECK-NOT: load
diff --git a/llvm/test/Transforms/NewGVN/memory-handling.ll b/llvm/test/Transforms/NewGVN/memory-handling.ll
index cd1b3a3e9770..b1e1c4f2de3e 100644
--- a/llvm/test/Transforms/NewGVN/memory-handling.ll
+++ b/llvm/test/Transforms/NewGVN/memory-handling.ll
@@ -13,28 +13,28 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
; Function Attrs: nounwind uwtable
-declare void @Fatal(i8*, i32) local_unnamed_addr #0
+declare void @Fatal(ptr, i32) local_unnamed_addr #0
; Function Attrs: nounwind readnone
-declare i16** @__ctype_b_loc() local_unnamed_addr #1
+declare ptr @__ctype_b_loc() local_unnamed_addr #1
; Function Attrs: nounwind uwtable
-define void @BuildMask(i8* nocapture readonly) local_unnamed_addr #0 {
- tail call void @llvm.memset.p0i8.i64(i8* align 16 bitcast ([26 x %struct.Letter]* @alPhrase to i8*), i8 0, i64 416, i1 false)
- tail call void @llvm.memset.p0i8.i64(i8* align 16 bitcast ([2 x i64]* @aqMainMask to i8*), i8 0, i64 16, i1 false)
- tail call void @llvm.memset.p0i8.i64(i8* align 16 bitcast ([2 x i64]* @aqMainSign to i8*), i8 0, i64 16, i1 false)
+define void @BuildMask(ptr nocapture readonly) local_unnamed_addr #0 {
+ tail call void @llvm.memset.p0.i64(ptr align 16 @alPhrase, i8 0, i64 416, i1 false)
+ tail call void @llvm.memset.p0.i64(ptr align 16 @aqMainMask, i8 0, i64 16, i1 false)
+ tail call void @llvm.memset.p0.i64(ptr align 16 @aqMainSign, i8 0, i64 16, i1 false)
br label %.sink.split
.sink.split: ; preds = %14, %1
- %.0 = phi i8* [ %0, %1 ], [ %.lcssa67, %14 ]
+ %.0 = phi ptr [ %0, %1 ], [ %.lcssa67, %14 ]
%.sink = phi i32 [ 0, %1 ], [ %23, %14 ]
- store i32 %.sink, i32* @cchPhraseLength, align 4, !tbaa !1
+ store i32 %.sink, ptr @cchPhraseLength, align 4, !tbaa !1
br label %2
; <label>:2: ; preds = %6, %.sink.split
- %.1 = phi i8* [ %.0, %.sink.split ], [ %3, %6 ]
- %3 = getelementptr inbounds i8, i8* %.1, i64 1
- %4 = load i8, i8* %.1, align 1, !tbaa !5
+ %.1 = phi ptr [ %.0, %.sink.split ], [ %3, %6 ]
+ %3 = getelementptr inbounds i8, ptr %.1, i64 1
+ %4 = load i8, ptr %.1, align 1, !tbaa !5
%5 = icmp eq i8 %4, 0
br i1 %5, label %.preheader.preheader, label %6
@@ -42,27 +42,27 @@ define void @BuildMask(i8* nocapture readonly) local_unnamed_addr #0 {
br label %.preheader
; <label>:6: ; preds = %2
- %7 = tail call i16** @__ctype_b_loc() #4
- %8 = load i16*, i16** %7, align 8, !tbaa !6
+ %7 = tail call ptr @__ctype_b_loc() #4
+ %8 = load ptr, ptr %7, align 8, !tbaa !6
%9 = sext i8 %4 to i64
- %10 = getelementptr inbounds i16, i16* %8, i64 %9
- %11 = load i16, i16* %10, align 2, !tbaa !8
+ %10 = getelementptr inbounds i16, ptr %8, i64 %9
+ %11 = load i16, ptr %10, align 2, !tbaa !8
%12 = and i16 %11, 1024
%13 = icmp eq i16 %12, 0
br i1 %13, label %2, label %14
; <label>:14: ; preds = %6
- %.lcssa67 = phi i8* [ %3, %6 ]
+ %.lcssa67 = phi ptr [ %3, %6 ]
%.lcssa65 = phi i8 [ %4, %6 ]
%15 = sext i8 %.lcssa65 to i32
%16 = tail call i32 @tolower(i32 %15) #5
%17 = add nsw i32 %16, -97
%18 = sext i32 %17 to i64
- %19 = getelementptr inbounds [26 x %struct.Letter], [26 x %struct.Letter]* @alPhrase, i64 0, i64 %18, i32 0
- %20 = load i32, i32* %19, align 16, !tbaa !10
+ %19 = getelementptr inbounds [26 x %struct.Letter], ptr @alPhrase, i64 0, i64 %18, i32 0
+ %20 = load i32, ptr %19, align 16, !tbaa !10
%21 = add i32 %20, 1
- store i32 %21, i32* %19, align 16, !tbaa !10
- %22 = load i32, i32* @cchPhraseLength, align 4, !tbaa !1
+ store i32 %21, ptr %19, align 16, !tbaa !10
+ %22 = load i32, ptr @cchPhraseLength, align 4, !tbaa !1
%23 = add nsw i32 %22, 1
br label %.sink.split
@@ -70,18 +70,18 @@ define void @BuildMask(i8* nocapture readonly) local_unnamed_addr #0 {
%indvars.iv = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next, %58 ]
%.04961 = phi i32 [ %.2, %58 ], [ 0, %.preheader.preheader ]
%.05160 = phi i32 [ %.253, %58 ], [ 0, %.preheader.preheader ]
- %24 = getelementptr inbounds [26 x %struct.Letter], [26 x %struct.Letter]* @alPhrase, i64 0, i64 %indvars.iv, i32 0
- %25 = load i32, i32* %24, align 16, !tbaa !10
+ %24 = getelementptr inbounds [26 x %struct.Letter], ptr @alPhrase, i64 0, i64 %indvars.iv, i32 0
+ %25 = load i32, ptr %24, align 16, !tbaa !10
%26 = icmp eq i32 %25, 0
- %27 = getelementptr inbounds [26 x i32], [26 x i32]* @auGlobalFrequency, i64 0, i64 %indvars.iv
+ %27 = getelementptr inbounds [26 x i32], ptr @auGlobalFrequency, i64 0, i64 %indvars.iv
br i1 %26, label %28, label %29
; <label>:28: ; preds = %.preheader
- store i32 -1, i32* %27, align 4, !tbaa !1
+ store i32 -1, ptr %27, align 4, !tbaa !1
br label %58
; <label>:29: ; preds = %.preheader
- store i32 0, i32* %27, align 4, !tbaa !1
+ store i32 0, ptr %27, align 4, !tbaa !1
%30 = zext i32 %25 to i64
br i1 false, label %._crit_edge, label %.lr.ph.preheader
@@ -119,7 +119,7 @@ define void @BuildMask(i8* nocapture readonly) local_unnamed_addr #0 {
br i1 %38, label %39, label %40
; <label>:39: ; preds = %36
- tail call void @Fatal(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i32 0)
+ tail call void @Fatal(ptr @.str.7, i32 0)
br label %40
; <label>:40: ; preds = %39, %36, %._crit_edge
@@ -127,26 +127,26 @@ define void @BuildMask(i8* nocapture readonly) local_unnamed_addr #0 {
%.150 = phi i32 [ %.04961, %._crit_edge ], [ 0, %39 ], [ 0, %36 ]
%41 = add i64 %.046.lcssa, 4294967295
%42 = trunc i64 %41 to i32
- %43 = getelementptr inbounds [26 x %struct.Letter], [26 x %struct.Letter]* @alPhrase, i64 0, i64 %indvars.iv, i32 2
- store i32 %42, i32* %43, align 8, !tbaa !12
+ %43 = getelementptr inbounds [26 x %struct.Letter], ptr @alPhrase, i64 0, i64 %indvars.iv, i32 2
+ store i32 %42, ptr %43, align 8, !tbaa !12
%44 = zext i32 %.150 to i64
%.046. = shl i64 %.046.lcssa, %44
%45 = zext i32 %.152 to i64
- %46 = getelementptr inbounds [2 x i64], [2 x i64]* @aqMainSign, i64 0, i64 %45
- %47 = load i64, i64* %46, align 8, !tbaa !13
+ %46 = getelementptr inbounds [2 x i64], ptr @aqMainSign, i64 0, i64 %45
+ %47 = load i64, ptr %46, align 8, !tbaa !13
%48 = or i64 %47, %.046.
- store i64 %48, i64* %46, align 8, !tbaa !13
- %49 = load i32, i32* %24, align 16, !tbaa !10
+ store i64 %48, ptr %46, align 8, !tbaa !13
+ %49 = load i32, ptr %24, align 16, !tbaa !10
%50 = zext i32 %49 to i64
%51 = shl i64 %50, %44
- %52 = getelementptr inbounds [2 x i64], [2 x i64]* @aqMainMask, i64 0, i64 %45
- %53 = load i64, i64* %52, align 8, !tbaa !13
+ %52 = getelementptr inbounds [2 x i64], ptr @aqMainMask, i64 0, i64 %45
+ %53 = load i64, ptr %52, align 8, !tbaa !13
%54 = or i64 %51, %53
- store i64 %54, i64* %52, align 8, !tbaa !13
- %55 = getelementptr inbounds [26 x %struct.Letter], [26 x %struct.Letter]* @alPhrase, i64 0, i64 %indvars.iv, i32 1
- store i32 %.150, i32* %55, align 4, !tbaa !15
- %56 = getelementptr inbounds [26 x %struct.Letter], [26 x %struct.Letter]* @alPhrase, i64 0, i64 %indvars.iv, i32 3
- store i32 %.152, i32* %56, align 4, !tbaa !16
+ store i64 %54, ptr %52, align 8, !tbaa !13
+ %55 = getelementptr inbounds [26 x %struct.Letter], ptr @alPhrase, i64 0, i64 %indvars.iv, i32 1
+ store i32 %.150, ptr %55, align 4, !tbaa !15
+ %56 = getelementptr inbounds [26 x %struct.Letter], ptr @alPhrase, i64 0, i64 %indvars.iv, i32 3
+ store i32 %.152, ptr %56, align 4, !tbaa !16
%57 = add nsw i32 %.150, %.048.lcssa
br label %58
@@ -162,7 +162,7 @@ define void @BuildMask(i8* nocapture readonly) local_unnamed_addr #0 {
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1) #2
+declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1) #2
; Function Attrs: inlinehint nounwind readonly uwtable
declare i32 @tolower(i32) local_unnamed_addr #3
diff --git a/llvm/test/Transforms/NewGVN/metadata-nonnull.ll b/llvm/test/Transforms/NewGVN/metadata-nonnull.ll
index 465b2d265b34..4b050666d54e 100644
--- a/llvm/test/Transforms/NewGVN/metadata-nonnull.ll
+++ b/llvm/test/Transforms/NewGVN/metadata-nonnull.ll
@@ -2,175 +2,175 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define i8* @test1(i8** %v0, i8** %v1) {
+define ptr @test1(ptr %v0, ptr %v1) {
; CHECK-LABEL: @test1(
; CHECK-NEXT: top:
-; CHECK-NEXT: [[V2:%.*]] = load i8*, i8** [[V0:%[a-z0-9]+]], align 8, !nonnull !0
-; CHECK-NEXT: store i8* [[V2]], i8** [[V1:%.*]]
-; CHECK-NEXT: ret i8* [[V2]]
+; CHECK-NEXT: [[V2:%.*]] = load ptr, ptr [[V0:%[a-z0-9]+]], align 8, !nonnull !0
+; CHECK-NEXT: store ptr [[V2]], ptr [[V1:%.*]]
+; CHECK-NEXT: ret ptr [[V2]]
;
top:
- %v2 = load i8*, i8** %v0, !nonnull !0
- store i8* %v2, i8** %v1
- %v3 = load i8*, i8** %v1
- ret i8* %v3
+ %v2 = load ptr, ptr %v0, !nonnull !0
+ store ptr %v2, ptr %v1
+ %v3 = load ptr, ptr %v1
+ ret ptr %v3
}
; FIXME: could propagate nonnull to first load?
-define i8* @test2(i8** %v0, i8** %v1) {
+define ptr @test2(ptr %v0, ptr %v1) {
; CHECK-LABEL: @test2(
; CHECK-NEXT: top:
-; CHECK-NEXT: [[V2:%.*]] = load i8*, i8** [[V0:%[a-z0-9]+]]
+; CHECK-NEXT: [[V2:%.*]] = load ptr, ptr [[V0:%[a-z0-9]+]]
; CHECK-NOT: !nonnull
-; CHECK-NEXT: store i8* [[V2]], i8** [[V1:%.*]]
-; CHECK-NEXT: ret i8* [[V2]]
+; CHECK-NEXT: store ptr [[V2]], ptr [[V1:%.*]]
+; CHECK-NEXT: ret ptr [[V2]]
;
top:
- %v2 = load i8*, i8** %v0
- store i8* %v2, i8** %v1
- %v3 = load i8*, i8** %v1, !nonnull !0
- ret i8* %v3
+ %v2 = load ptr, ptr %v0
+ store ptr %v2, ptr %v1
+ %v3 = load ptr, ptr %v1, !nonnull !0
+ ret ptr %v3
}
-declare void @use1(i8* %a) readonly
+declare void @use1(ptr %a) readonly
-define i8* @test3(i8** %v0) {
+define ptr @test3(ptr %v0) {
; CHECK-LABEL: @test3(
; CHECK-NEXT: top:
-; CHECK-NEXT: [[V1:%.*]] = load i8*, i8** [[V0:%[a-z0-9]+]]
+; CHECK-NEXT: [[V1:%.*]] = load ptr, ptr [[V0:%[a-z0-9]+]]
; CHECK-NOT: !nonnull
-; CHECK-NEXT: call void @use1(i8* [[V1]])
+; CHECK-NEXT: call void @use1(ptr [[V1]])
; CHECK-NEXT: br i1 undef, label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: ret i8* [[V1]]
+; CHECK-NEXT: ret ptr [[V1]]
; CHECK: bb2:
-; CHECK-NEXT: ret i8* [[V1]]
+; CHECK-NEXT: ret ptr [[V1]]
;
top:
- %v1 = load i8*, i8** %v0
- call void @use1(i8* %v1)
+ %v1 = load ptr, ptr %v0
+ call void @use1(ptr %v1)
br i1 undef, label %bb1, label %bb2
bb1:
- %v2 = load i8*, i8** %v0, !nonnull !0
- ret i8* %v2
+ %v2 = load ptr, ptr %v0, !nonnull !0
+ ret ptr %v2
bb2:
- %v3 = load i8*, i8** %v0
- ret i8* %v3
+ %v3 = load ptr, ptr %v0
+ ret ptr %v3
}
-define i8* @test4(i8** %v0) {
+define ptr @test4(ptr %v0) {
; CHECK-LABEL: @test4(
; CHECK-NEXT: top:
-; CHECK-NEXT: [[V1:%.*]] = load i8*, i8** [[V0:%[a-z0-9]+]]
+; CHECK-NEXT: [[V1:%.*]] = load ptr, ptr [[V0:%[a-z0-9]+]]
; CHECK-NOT: !nonnull
-; CHECK-NEXT: call void @use1(i8* [[V1]])
+; CHECK-NEXT: call void @use1(ptr [[V1]])
; CHECK-NEXT: br i1 undef, label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: ret i8* [[V1]]
+; CHECK-NEXT: ret ptr [[V1]]
; CHECK: bb2:
-; CHECK-NEXT: ret i8* [[V1]]
+; CHECK-NEXT: ret ptr [[V1]]
;
top:
- %v1 = load i8*, i8** %v0
- call void @use1(i8* %v1)
+ %v1 = load ptr, ptr %v0
+ call void @use1(ptr %v1)
br i1 undef, label %bb1, label %bb2
bb1:
- %v2 = load i8*, i8** %v0
- ret i8* %v2
+ %v2 = load ptr, ptr %v0
+ ret ptr %v2
bb2:
- %v3 = load i8*, i8** %v0, !nonnull !0
- ret i8* %v3
+ %v3 = load ptr, ptr %v0, !nonnull !0
+ ret ptr %v3
}
-define i8* @test5(i8** %v0) {
+define ptr @test5(ptr %v0) {
; CHECK-LABEL: @test5(
; CHECK-NEXT: top:
-; CHECK-NEXT: [[V1:%.*]] = load i8*, i8** [[V0:%[a-z0-9]+]], align 8, !nonnull !0
-; CHECK-NEXT: call void @use1(i8* [[V1]])
+; CHECK-NEXT: [[V1:%.*]] = load ptr, ptr [[V0:%[a-z0-9]+]], align 8, !nonnull !0
+; CHECK-NEXT: call void @use1(ptr [[V1]])
; CHECK-NEXT: br i1 undef, label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: ret i8* [[V1]]
+; CHECK-NEXT: ret ptr [[V1]]
; CHECK: bb2:
-; CHECK-NEXT: ret i8* [[V1]]
+; CHECK-NEXT: ret ptr [[V1]]
;
top:
- %v1 = load i8*, i8** %v0, !nonnull !0
- call void @use1(i8* %v1)
+ %v1 = load ptr, ptr %v0, !nonnull !0
+ call void @use1(ptr %v1)
br i1 undef, label %bb1, label %bb2
bb1:
- %v2 = load i8*, i8** %v0
- ret i8* %v2
+ %v2 = load ptr, ptr %v0
+ ret ptr %v2
bb2:
- %v3 = load i8*, i8** %v0
- ret i8* %v3
+ %v3 = load ptr, ptr %v0
+ ret ptr %v3
}
-define i8* @test6(i8** %v0, i8** %v1) {
+define ptr @test6(ptr %v0, ptr %v1) {
; CHECK-LABEL: @test6(
; CHECK-NEXT: top:
; CHECK-NEXT: br i1 undef, label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[V2:%.*]] = load i8*, i8** [[V0:%[a-z0-9]+]], align 8, !nonnull !0
-; CHECK-NEXT: store i8* [[V2]], i8** [[V1:%.*]]
-; CHECK-NEXT: ret i8* [[V2]]
+; CHECK-NEXT: [[V2:%.*]] = load ptr, ptr [[V0:%[a-z0-9]+]], align 8, !nonnull !0
+; CHECK-NEXT: store ptr [[V2]], ptr [[V1:%.*]]
+; CHECK-NEXT: ret ptr [[V2]]
; CHECK: bb2:
-; CHECK-NEXT: [[V4:%.*]] = load i8*, i8** [[V0]]
+; CHECK-NEXT: [[V4:%.*]] = load ptr, ptr [[V0]]
; CHECK-NOT: !nonnull
-; CHECK-NEXT: store i8* [[V4]], i8** [[V1]]
+; CHECK-NEXT: store ptr [[V4]], ptr [[V1]]
; CHECK-NOT: !nonnull
-; CHECK-NEXT: ret i8* [[V4]]
+; CHECK-NEXT: ret ptr [[V4]]
;
top:
br i1 undef, label %bb1, label %bb2
bb1:
- %v2 = load i8*, i8** %v0, !nonnull !0
- store i8* %v2, i8** %v1
- %v3 = load i8*, i8** %v1
- ret i8* %v3
+ %v2 = load ptr, ptr %v0, !nonnull !0
+ store ptr %v2, ptr %v1
+ %v3 = load ptr, ptr %v1
+ ret ptr %v3
bb2:
- %v4 = load i8*, i8** %v0
- store i8* %v4, i8** %v1
- %v5 = load i8*, i8** %v1, !nonnull !0
- ret i8* %v5
+ %v4 = load ptr, ptr %v0
+ store ptr %v4, ptr %v1
+ %v5 = load ptr, ptr %v1, !nonnull !0
+ ret ptr %v5
}
-declare void @use2(i8* %a)
+declare void @use2(ptr %a)
-define i8* @test7(i8** %v0) {
+define ptr @test7(ptr %v0) {
; CHECK-LABEL: @test7(
; CHECK-NEXT: top:
-; CHECK-NEXT: [[V1:%.*]] = load i8*, i8** [[V0:%[a-z0-9]+]], align 8, !nonnull !0
-; CHECK-NEXT: call void @use2(i8* [[V1]])
+; CHECK-NEXT: [[V1:%.*]] = load ptr, ptr [[V0:%[a-z0-9]+]], align 8, !nonnull !0
+; CHECK-NEXT: call void @use2(ptr [[V1]])
; CHECK-NEXT: br i1 undef, label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[V2:%.*]] = load i8*, i8** [[V0]]
+; CHECK-NEXT: [[V2:%.*]] = load ptr, ptr [[V0]]
; CHECK-NOT: !nonnull
-; CHECK-NEXT: ret i8* [[V2]]
+; CHECK-NEXT: ret ptr [[V2]]
; CHECK: bb2:
-; CHECK-NEXT: [[V3:%.*]] = load i8*, i8** [[V0]]
+; CHECK-NEXT: [[V3:%.*]] = load ptr, ptr [[V0]]
; CHECK-NOT: !nonnull
-; CHECK-NEXT: ret i8* [[V3]]
+; CHECK-NEXT: ret ptr [[V3]]
;
top:
- %v1 = load i8*, i8** %v0, !nonnull !0
- call void @use2(i8* %v1)
+ %v1 = load ptr, ptr %v0, !nonnull !0
+ call void @use2(ptr %v1)
br i1 undef, label %bb1, label %bb2
bb1:
- %v2 = load i8*, i8** %v0
- ret i8* %v2
+ %v2 = load ptr, ptr %v0
+ ret ptr %v2
bb2:
- %v3 = load i8*, i8** %v0
- ret i8* %v3
+ %v3 = load ptr, ptr %v0
+ ret ptr %v3
}
!0 = !{}
diff --git a/llvm/test/Transforms/NewGVN/metadata-simplify.ll b/llvm/test/Transforms/NewGVN/metadata-simplify.ll
index 1178d62fbe65..a84c581165c3 100644
--- a/llvm/test/Transforms/NewGVN/metadata-simplify.ll
+++ b/llvm/test/Transforms/NewGVN/metadata-simplify.ll
@@ -5,153 +5,153 @@
; RUN: opt < %s -S -passes=newgvn | FileCheck %s
-define i1 @test1(i32** %arg, i1 %arg2) {
+define i1 @test1(ptr %arg, i1 %arg2) {
; CHECK-LABEL: @test1(
; CHECK-NEXT: br i1 [[ARG2:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[LOAD1:%.*]] = load i32*, i32** [[ARG:%.*]], !nonnull !0
-; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32* [[LOAD1]], null
+; CHECK-NEXT: [[LOAD1:%.*]] = load ptr, ptr [[ARG:%.*]], !nonnull !0
+; CHECK-NEXT: [[CMP1:%.*]] = icmp eq ptr [[LOAD1]], null
; CHECK-NEXT: ret i1 [[CMP1]]
; CHECK: bb2:
-; CHECK-NEXT: [[LOAD2:%.*]] = load i32*, i32** [[ARG]]
-; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i32* [[LOAD2]], null
+; CHECK-NEXT: [[LOAD2:%.*]] = load ptr, ptr [[ARG]]
+; CHECK-NEXT: [[CMP2:%.*]] = icmp eq ptr [[LOAD2]], null
; CHECK-NEXT: ret i1 [[CMP2]]
;
br i1 %arg2, label %bb1, label %bb2
bb1:
- %load1 = load i32*, i32** %arg, !nonnull !0
- %cmp1 = icmp eq i32* %load1, null
+ %load1 = load ptr, ptr %arg, !nonnull !0
+ %cmp1 = icmp eq ptr %load1, null
ret i1 %cmp1
bb2:
- %load2 = load i32*, i32** %arg
- %cmp2 = icmp eq i32* %load2, null
+ %load2 = load ptr, ptr %arg
+ %cmp2 = icmp eq ptr %load2, null
ret i1 %cmp2
}
-define i1 @test2(i32** %arg, i1 %arg2) {
+define i1 @test2(ptr %arg, i1 %arg2) {
; CHECK-LABEL: @test2(
; CHECK-NEXT: br i1 [[ARG2:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[LOAD1:%.*]] = load i32*, i32** [[ARG:%.*]]
-; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32* [[LOAD1]], null
+; CHECK-NEXT: [[LOAD1:%.*]] = load ptr, ptr [[ARG:%.*]]
+; CHECK-NEXT: [[CMP1:%.*]] = icmp eq ptr [[LOAD1]], null
; CHECK-NEXT: ret i1 [[CMP1]]
; CHECK: bb2:
-; CHECK-NEXT: [[LOAD2:%.*]] = load i32*, i32** [[ARG]], !nonnull !0
-; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i32* [[LOAD2]], null
+; CHECK-NEXT: [[LOAD2:%.*]] = load ptr, ptr [[ARG]], !nonnull !0
+; CHECK-NEXT: [[CMP2:%.*]] = icmp eq ptr [[LOAD2]], null
; CHECK-NEXT: ret i1 [[CMP2]]
;
br i1 %arg2, label %bb1, label %bb2
bb1:
- %load1 = load i32*, i32** %arg
- %cmp1 = icmp eq i32* %load1, null
+ %load1 = load ptr, ptr %arg
+ %cmp1 = icmp eq ptr %load1, null
ret i1 %cmp1
bb2:
- %load2 = load i32*, i32** %arg, !nonnull !0
- %cmp2 = icmp eq i32* %load2, null
+ %load2 = load ptr, ptr %arg, !nonnull !0
+ %cmp2 = icmp eq ptr %load2, null
ret i1 %cmp2
}
-define i1 @test3(i32* %ptr, i1 %arg2) {
+define i1 @test3(ptr %ptr, i1 %arg2) {
; CHECK-LABEL: @test3(
; CHECK-NEXT: br i1 [[ARG2:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[LOAD1:%.*]] = load i32, i32* [[PTR:%.*]], !range !1
+; CHECK-NEXT: [[LOAD1:%.*]] = load i32, ptr [[PTR:%.*]], !range !1
; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i32 [[LOAD1]], 999
; CHECK-NEXT: ret i1 [[CMP1]]
; CHECK: bb2:
-; CHECK-NEXT: [[LOAD2:%.*]] = load i32, i32* [[PTR]]
+; CHECK-NEXT: [[LOAD2:%.*]] = load i32, ptr [[PTR]]
; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i32 [[LOAD2]], 999
; CHECK-NEXT: ret i1 [[CMP2]]
;
br i1 %arg2, label %bb1, label %bb2
bb1:
- %load1 = load i32, i32* %ptr, !range !1
+ %load1 = load i32, ptr %ptr, !range !1
%cmp1 = icmp ne i32 %load1, 999
ret i1 %cmp1
bb2:
- %load2 = load i32, i32* %ptr
+ %load2 = load i32, ptr %ptr
%cmp2 = icmp ne i32 %load2, 999
ret i1 %cmp2
}
-define i1 @test4(i32* %ptr, i1 %arg2) {
+define i1 @test4(ptr %ptr, i1 %arg2) {
; CHECK-LABEL: @test4(
; CHECK-NEXT: br i1 [[ARG2:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[LOAD1:%.*]] = load i32, i32* [[PTR:%.*]]
+; CHECK-NEXT: [[LOAD1:%.*]] = load i32, ptr [[PTR:%.*]]
; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i32 [[LOAD1]], 999
; CHECK-NEXT: ret i1 [[CMP1]]
; CHECK: bb2:
-; CHECK-NEXT: [[LOAD2:%.*]] = load i32, i32* [[PTR]], !range !1
+; CHECK-NEXT: [[LOAD2:%.*]] = load i32, ptr [[PTR]], !range !1
; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i32 [[LOAD2]], 999
; CHECK-NEXT: ret i1 [[CMP2]]
;
br i1 %arg2, label %bb1, label %bb2
bb1:
- %load1 = load i32, i32* %ptr
+ %load1 = load i32, ptr %ptr
%cmp1 = icmp ne i32 %load1, 999
ret i1 %cmp1
bb2:
- %load2 = load i32, i32* %ptr, !range !1
+ %load2 = load i32, ptr %ptr, !range !1
%cmp2 = icmp ne i32 %load2, 999
ret i1 %cmp2
}
-define i1 @test5(i32* %ptr, i1 %arg2) {
+define i1 @test5(ptr %ptr, i1 %arg2) {
; CHECK-LABEL: @test5(
; CHECK-NEXT: br i1 [[ARG2:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[LOAD1:%.*]] = load i32, i32* [[PTR:%.*]], !range !1
+; CHECK-NEXT: [[LOAD1:%.*]] = load i32, ptr [[PTR:%.*]], !range !1
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[LOAD1]], 999
; CHECK-NEXT: ret i1 [[CMP1]]
; CHECK: bb2:
-; CHECK-NEXT: [[LOAD2:%.*]] = load i32, i32* [[PTR]]
+; CHECK-NEXT: [[LOAD2:%.*]] = load i32, ptr [[PTR]]
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[LOAD2]], 999
; CHECK-NEXT: ret i1 [[CMP2]]
;
br i1 %arg2, label %bb1, label %bb2
bb1:
- %load1 = load i32, i32* %ptr, !range !1
+ %load1 = load i32, ptr %ptr, !range !1
%cmp1 = icmp slt i32 %load1, 999
ret i1 %cmp1
bb2:
- %load2 = load i32, i32* %ptr
+ %load2 = load i32, ptr %ptr
%cmp2 = icmp slt i32 %load2, 999
ret i1 %cmp2
}
-define i1 @test6(i32* %ptr, i1 %arg2) {
+define i1 @test6(ptr %ptr, i1 %arg2) {
; CHECK-LABEL: @test6(
; CHECK-NEXT: br i1 [[ARG2:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[LOAD1:%.*]] = load i32, i32* [[PTR:%.*]]
+; CHECK-NEXT: [[LOAD1:%.*]] = load i32, ptr [[PTR:%.*]]
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[LOAD1]], 999
; CHECK-NEXT: ret i1 [[CMP1]]
; CHECK: bb2:
-; CHECK-NEXT: [[LOAD2:%.*]] = load i32, i32* [[PTR]], !range !1
+; CHECK-NEXT: [[LOAD2:%.*]] = load i32, ptr [[PTR]], !range !1
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[LOAD2]], 999
; CHECK-NEXT: ret i1 [[CMP2]]
;
br i1 %arg2, label %bb1, label %bb2
bb1:
- %load1 = load i32, i32* %ptr
+ %load1 = load i32, ptr %ptr
%cmp1 = icmp slt i32 %load1, 999
ret i1 %cmp1
bb2:
- %load2 = load i32, i32* %ptr, !range !1
+ %load2 = load i32, ptr %ptr, !range !1
%cmp2 = icmp slt i32 %load2, 999
ret i1 %cmp2
}
diff --git a/llvm/test/Transforms/NewGVN/noalias.ll b/llvm/test/Transforms/NewGVN/noalias.ll
index 1beda5305f44..5f0c5dd8a3ae 100644
--- a/llvm/test/Transforms/NewGVN/noalias.ll
+++ b/llvm/test/Transforms/NewGVN/noalias.ll
@@ -1,39 +1,39 @@
; RUN: opt -passes=newgvn -S < %s | FileCheck %s
-define i32 @test1(i32* %p, i32* %q) {
-; CHECK-LABEL: @test1(i32* %p, i32* %q)
-; CHECK: load i32, i32* %p
+define i32 @test1(ptr %p, ptr %q) {
+; CHECK-LABEL: @test1(ptr %p, ptr %q)
+; CHECK: load i32, ptr %p
; CHECK-NOT: noalias
; CHECK: %c = add i32 %a, %a
- %a = load i32, i32* %p, !noalias !3
- %b = load i32, i32* %p
+ %a = load i32, ptr %p, !noalias !3
+ %b = load i32, ptr %p
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test2(i32* %p, i32* %q) {
-; CHECK-LABEL: @test2(i32* %p, i32* %q)
-; CHECK: load i32, i32* %p, align 4, !alias.scope ![[SCOPE1:[0-9]+]]
+define i32 @test2(ptr %p, ptr %q) {
+; CHECK-LABEL: @test2(ptr %p, ptr %q)
+; CHECK: load i32, ptr %p, align 4, !alias.scope ![[SCOPE1:[0-9]+]]
; CHECK: %c = add i32 %a, %a
- %a = load i32, i32* %p, !alias.scope !3
- %b = load i32, i32* %p, !alias.scope !3
+ %a = load i32, ptr %p, !alias.scope !3
+ %b = load i32, ptr %p, !alias.scope !3
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test3(i32* %p, i32* %q) {
-; CHECK-LABEL: @test3(i32* %p, i32* %q)
-; CHECK: load i32, i32* %p, align 4, !alias.scope ![[SCOPE2:[0-9]+]]
+define i32 @test3(ptr %p, ptr %q) {
+; CHECK-LABEL: @test3(ptr %p, ptr %q)
+; CHECK: load i32, ptr %p, align 4, !alias.scope ![[SCOPE2:[0-9]+]]
; CHECK: %c = add i32 %a, %a
- %a = load i32, i32* %p, !alias.scope !4
- %b = load i32, i32* %p, !alias.scope !5
+ %a = load i32, ptr %p, !alias.scope !4
+ %b = load i32, ptr %p, !alias.scope !5
%c = add i32 %a, %b
ret i32 %c
}
; CHECK: ![[SCOPE1]] = !{!{{[0-9]+}}}
; CHECK: ![[SCOPE2]] = !{!{{[0-9]+}}, !{{[0-9]+}}}
-declare i32 @foo(i32*) readonly
+declare i32 @foo(ptr) readonly
!0 = distinct !{!0, !2, !"callee0: %a"}
!1 = distinct !{!1, !2, !"callee0: %b"}
diff --git a/llvm/test/Transforms/NewGVN/non-integral-pointers.ll b/llvm/test/Transforms/NewGVN/non-integral-pointers.ll
index 9bef9458a890..6119577d3b24 100644
--- a/llvm/test/Transforms/NewGVN/non-integral-pointers.ll
+++ b/llvm/test/Transforms/NewGVN/non-integral-pointers.ll
@@ -3,35 +3,33 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:4"
target triple = "x86_64-unknown-linux-gnu"
-define void @f0(i1 %alwaysFalse, i64 %val, i64* %loc) {
+define void @f0(i1 %alwaysFalse, i64 %val, ptr %loc) {
; CHECK-LABEL: @f0(
; CHECK-NOT: inttoptr
; CHECK-NOT: ptrtoint
entry:
- store i64 %val, i64* %loc
+ store i64 %val, ptr %loc
br i1 %alwaysFalse, label %neverTaken, label %alwaysTaken
neverTaken:
- %loc.bc = bitcast i64* %loc to i8 addrspace(4)**
- %ptr = load i8 addrspace(4)*, i8 addrspace(4)** %loc.bc
- store i8 5, i8 addrspace(4)* %ptr
+ %ptr = load ptr addrspace(4), ptr %loc
+ store i8 5, ptr addrspace(4) %ptr
ret void
alwaysTaken:
ret void
}
-define i64 @f1(i1 %alwaysFalse, i8 addrspace(4)* %val, i8 addrspace(4)** %loc) {
+define i64 @f1(i1 %alwaysFalse, ptr addrspace(4) %val, ptr %loc) {
; CHECK-LABEL: @f1(
; CHECK-NOT: inttoptr
; CHECK-NOT: ptrtoint
entry:
- store i8 addrspace(4)* %val, i8 addrspace(4)** %loc
+ store ptr addrspace(4) %val, ptr %loc
br i1 %alwaysFalse, label %neverTaken, label %alwaysTaken
neverTaken:
- %loc.bc = bitcast i8 addrspace(4)** %loc to i64*
- %int = load i64, i64* %loc.bc
+ %int = load i64, ptr %loc
ret i64 %int
alwaysTaken:
diff --git a/llvm/test/Transforms/NewGVN/nonescaping-malloc-xfail.ll b/llvm/test/Transforms/NewGVN/nonescaping-malloc-xfail.ll
index 9f931c7b3502..0271ce2837fc 100644
--- a/llvm/test/Transforms/NewGVN/nonescaping-malloc-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/nonescaping-malloc-xfail.ll
@@ -15,98 +15,91 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
target triple = "x86_64-apple-darwin10.0"
%"struct.llvm::MallocAllocator" = type <{ i8 }>
-%"struct.llvm::StringMap<void*,llvm::MallocAllocator>" = type { %"struct.llvm::StringMapImpl", %"struct.llvm::MallocAllocator" }
-%"struct.llvm::StringMapEntry<void*>" = type { %"struct.llvm::StringMapEntryBase", i8* }
+%"struct.llvm::StringMap<ptr,llvm::MallocAllocator>" = type { %"struct.llvm::StringMapImpl", %"struct.llvm::MallocAllocator" }
+%"struct.llvm::StringMapEntry<ptr>" = type { %"struct.llvm::StringMapEntryBase", ptr }
%"struct.llvm::StringMapEntryBase" = type { i32 }
-%"struct.llvm::StringMapImpl" = type { %"struct.llvm::StringMapImpl::ItemBucket"*, i32, i32, i32, i32 }
-%"struct.llvm::StringMapImpl::ItemBucket" = type { i32, %"struct.llvm::StringMapEntryBase"* }
-%"struct.llvm::StringRef" = type { i8*, i64 }
+%"struct.llvm::StringMapImpl" = type { ptr, i32, i32, i32, i32 }
+%"struct.llvm::StringMapImpl::ItemBucket" = type { i32, ptr }
+%"struct.llvm::StringRef" = type { ptr, i64 }
-define %"struct.llvm::StringMapEntry<void*>"* @_Z3fooRN4llvm9StringMapIPvNS_15MallocAllocatorEEEPKc(%"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %X, i8* %P) ssp {
+define ptr @_Z3fooRN4llvm9StringMapIPvNS_15MallocAllocatorEEEPKc(ptr %X, ptr %P) ssp {
entry:
%tmp = alloca %"struct.llvm::StringRef", align 8
- %tmp.i = getelementptr inbounds %"struct.llvm::StringRef", %"struct.llvm::StringRef"* %tmp, i64 0, i32 0
- store i8* %P, i8** %tmp.i, align 8
- %tmp1.i = call i64 @strlen(i8* %P) nounwind readonly
- %tmp2.i = getelementptr inbounds %"struct.llvm::StringRef", %"struct.llvm::StringRef"* %tmp, i64 0, i32 1
- store i64 %tmp1.i, i64* %tmp2.i, align 8
- %tmp1 = call %"struct.llvm::StringMapEntry<void*>"* @_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueERKNS_9StringRefE(%"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %X, %"struct.llvm::StringRef"* %tmp) ssp
- ret %"struct.llvm::StringMapEntry<void*>"* %tmp1
+ store ptr %P, ptr %tmp, align 8
+ %tmp1.i = call i64 @strlen(ptr %P) nounwind readonly
+ %tmp2.i = getelementptr inbounds %"struct.llvm::StringRef", ptr %tmp, i64 0, i32 1
+ store i64 %tmp1.i, ptr %tmp2.i, align 8
+ %tmp1 = call ptr @_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueERKNS_9StringRefE(ptr %X, ptr %tmp) ssp
+ ret ptr %tmp1
}
-declare i64 @strlen(i8* nocapture) nounwind readonly
+declare i64 @strlen(ptr nocapture) nounwind readonly
-declare noalias i8* @malloc(i64) nounwind
+declare noalias ptr @malloc(i64) nounwind
-declare i32 @_ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE(%"struct.llvm::StringMapImpl"*, i64, i64)
+declare i32 @_ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE(ptr, i64, i64)
-define linkonce_odr %"struct.llvm::StringMapEntry<void*>"* @_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueERKNS_9StringRefE(%"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, %"struct.llvm::StringRef"* nocapture %Key) ssp align 2 {
+define linkonce_odr ptr @_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueERKNS_9StringRefE(ptr %this, ptr nocapture %Key) ssp align 2 {
entry:
- %elt = bitcast %"struct.llvm::StringRef"* %Key to i64*
- %val = load i64, i64* %elt
- %tmp = getelementptr inbounds %"struct.llvm::StringRef", %"struct.llvm::StringRef"* %Key, i64 0, i32 1
- %val2 = load i64, i64* %tmp
- %tmp2.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>", %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0
- %tmp3.i = tail call i32 @_ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE(%"struct.llvm::StringMapImpl"* %tmp2.i, i64 %val, i64 %val2)
- %tmp4.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>", %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0, i32 0
- %tmp5.i = load %"struct.llvm::StringMapImpl::ItemBucket"*, %"struct.llvm::StringMapImpl::ItemBucket"** %tmp4.i, align 8
+ %val = load i64, ptr %Key
+ %tmp = getelementptr inbounds %"struct.llvm::StringRef", ptr %Key, i64 0, i32 1
+ %val2 = load i64, ptr %tmp
+ %tmp2.i = getelementptr inbounds %"struct.llvm::StringMap<ptr,llvm::MallocAllocator>", ptr %this, i64 0, i32 0
+ %tmp3.i = tail call i32 @_ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE(ptr %tmp2.i, i64 %val, i64 %val2)
+ %tmp4.i = getelementptr inbounds %"struct.llvm::StringMap<ptr,llvm::MallocAllocator>", ptr %this, i64 0, i32 0, i32 0
+ %tmp5.i = load ptr, ptr %tmp4.i, align 8
%tmp6.i = zext i32 %tmp3.i to i64
- %tmp7.i = getelementptr inbounds %"struct.llvm::StringMapImpl::ItemBucket", %"struct.llvm::StringMapImpl::ItemBucket"* %tmp5.i, i64 %tmp6.i, i32 1
- %tmp8.i = load %"struct.llvm::StringMapEntryBase"*, %"struct.llvm::StringMapEntryBase"** %tmp7.i, align 8
- %tmp9.i = icmp eq %"struct.llvm::StringMapEntryBase"* %tmp8.i, null
- %tmp13.i = icmp eq %"struct.llvm::StringMapEntryBase"* %tmp8.i, inttoptr (i64 -1 to %"struct.llvm::StringMapEntryBase"*)
+ %tmp7.i = getelementptr inbounds %"struct.llvm::StringMapImpl::ItemBucket", ptr %tmp5.i, i64 %tmp6.i, i32 1
+ %tmp8.i = load ptr, ptr %tmp7.i, align 8
+ %tmp9.i = icmp eq ptr %tmp8.i, null
+ %tmp13.i = icmp eq ptr %tmp8.i, inttoptr (i64 -1 to ptr)
%or.cond.i = or i1 %tmp9.i, %tmp13.i
br i1 %or.cond.i, label %bb4.i, label %bb6.i
bb4.i: ; preds = %entry
- %tmp41.i = inttoptr i64 %val to i8*
- %tmp4.i35.i = getelementptr inbounds i8, i8* %tmp41.i, i64 %val2
- %tmp.i.i = ptrtoint i8* %tmp4.i35.i to i64
+ %tmp41.i = inttoptr i64 %val to ptr
+ %tmp4.i35.i = getelementptr inbounds i8, ptr %tmp41.i, i64 %val2
+ %tmp.i.i = ptrtoint ptr %tmp4.i35.i to i64
%tmp1.i.i = trunc i64 %tmp.i.i to i32
%tmp3.i.i = trunc i64 %val to i32
%tmp4.i.i = sub i32 %tmp1.i.i, %tmp3.i.i
%tmp5.i.i = add i32 %tmp4.i.i, 17
%tmp8.i.i = zext i32 %tmp5.i.i to i64
- %tmp.i20.i.i = tail call noalias i8* @malloc(i64 %tmp8.i.i) nounwind
- %tmp10.i.i = bitcast i8* %tmp.i20.i.i to %"struct.llvm::StringMapEntry<void*>"*
- %tmp12.i.i = icmp eq i8* %tmp.i20.i.i, null
+ %tmp.i20.i.i = tail call noalias ptr @malloc(i64 %tmp8.i.i) nounwind
+ %tmp12.i.i = icmp eq ptr %tmp.i20.i.i, null
br i1 %tmp12.i.i, label %_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i, label %bb.i.i
bb.i.i: ; preds = %bb4.i
- %tmp.i.i.i.i = bitcast i8* %tmp.i20.i.i to i32*
- store i32 %tmp4.i.i, i32* %tmp.i.i.i.i, align 4
- %tmp1.i19.i.i = getelementptr inbounds i8, i8* %tmp.i20.i.i, i64 8
- %0 = bitcast i8* %tmp1.i19.i.i to i8**
- store i8* null, i8** %0, align 8
+ store i32 %tmp4.i.i, ptr %tmp.i20.i.i, align 4
+ %tmp1.i19.i.i = getelementptr inbounds i8, ptr %tmp.i20.i.i, i64 8
+ store ptr null, ptr %tmp1.i19.i.i, align 8
br label %_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i
_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i: ; preds = %bb.i.i, %bb4.i
- %tmp.i18.i.i = getelementptr inbounds i8, i8* %tmp.i20.i.i, i64 16
+ %tmp.i18.i.i = getelementptr inbounds i8, ptr %tmp.i20.i.i, i64 16
%tmp15.i.i = zext i32 %tmp4.i.i to i64
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp.i18.i.i, i8* %tmp41.i, i64 %tmp15.i.i, i1 false)
+ tail call void @llvm.memcpy.p0.p0.i64(ptr %tmp.i18.i.i, ptr %tmp41.i, i64 %tmp15.i.i, i1 false)
%tmp.i18.sum.i.i = add i64 %tmp15.i.i, 16
- %tmp17.i.i = getelementptr inbounds i8, i8* %tmp.i20.i.i, i64 %tmp.i18.sum.i.i
- store i8 0, i8* %tmp17.i.i, align 1
- %tmp.i.i.i = getelementptr inbounds i8, i8* %tmp.i20.i.i, i64 8
- %1 = bitcast i8* %tmp.i.i.i to i8**
- store i8* null, i8** %1, align 8
- %tmp22.i = load %"struct.llvm::StringMapEntryBase"*, %"struct.llvm::StringMapEntryBase"** %tmp7.i, align 8
- %tmp24.i = icmp eq %"struct.llvm::StringMapEntryBase"* %tmp22.i, inttoptr (i64 -1 to %"struct.llvm::StringMapEntryBase"*)
+ %tmp17.i.i = getelementptr inbounds i8, ptr %tmp.i20.i.i, i64 %tmp.i18.sum.i.i
+ store i8 0, ptr %tmp17.i.i, align 1
+ %tmp.i.i.i = getelementptr inbounds i8, ptr %tmp.i20.i.i, i64 8
+ store ptr null, ptr %tmp.i.i.i, align 8
+ %tmp22.i = load ptr, ptr %tmp7.i, align 8
+ %tmp24.i = icmp eq ptr %tmp22.i, inttoptr (i64 -1 to ptr)
br i1 %tmp24.i, label %bb9.i, label %_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueIS1_EERNS_14StringMapEntryIS1_EENS_9StringRefET_.exit
bb6.i: ; preds = %entry
- %tmp16.i = bitcast %"struct.llvm::StringMapEntryBase"* %tmp8.i to %"struct.llvm::StringMapEntry<void*>"*
- ret %"struct.llvm::StringMapEntry<void*>"* %tmp16.i
+ ret ptr %tmp8.i
bb9.i: ; preds = %_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i
- %tmp25.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>", %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0, i32 3
- %tmp26.i = load i32, i32* %tmp25.i, align 8
+ %tmp25.i = getelementptr inbounds %"struct.llvm::StringMap<ptr,llvm::MallocAllocator>", ptr %this, i64 0, i32 0, i32 3
+ %tmp26.i = load i32, ptr %tmp25.i, align 8
%tmp27.i = add i32 %tmp26.i, -1
- store i32 %tmp27.i, i32* %tmp25.i, align 8
- ret %"struct.llvm::StringMapEntry<void*>"* %tmp10.i.i
+ store i32 %tmp27.i, ptr %tmp25.i, align 8
+ ret ptr %tmp.i20.i.i
_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueIS1_EERNS_14StringMapEntryIS1_EENS_9StringRefET_.exit: ; preds = %_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i
- ret %"struct.llvm::StringMapEntry<void*>"* %tmp10.i.i
+ ret ptr %tmp.i20.i.i
}
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounwind
diff --git a/llvm/test/Transforms/NewGVN/null-aliases-nothing.ll b/llvm/test/Transforms/NewGVN/null-aliases-nothing.ll
index 6193fd4615f1..666621119d4c 100644
--- a/llvm/test/Transforms/NewGVN/null-aliases-nothing.ll
+++ b/llvm/test/Transforms/NewGVN/null-aliases-nothing.ll
@@ -1,18 +1,17 @@
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
%t = type { i32 }
-declare void @test1f(i8*)
+declare void @test1f(ptr)
-define void @test1(%t* noalias %stuff ) {
- %p = getelementptr inbounds %t, %t* %stuff, i32 0, i32 0
- %before = load i32, i32* %p
+define void @test1(ptr noalias %stuff ) {
+ %before = load i32, ptr %stuff
- call void @test1f(i8* null)
+ call void @test1f(ptr null)
- %after = load i32, i32* %p ; <--- This should be a dead load
+ %after = load i32, ptr %stuff ; <--- This should be a dead load
%sum = add i32 %before, %after
- store i32 %sum, i32* %p
+ store i32 %sum, ptr %stuff
ret void
; CHECK: load
; CHECK-NOT: load
diff --git a/llvm/test/Transforms/NewGVN/opt-remarks-xfail.ll b/llvm/test/Transforms/NewGVN/opt-remarks-xfail.ll
index dc08454bf462..48d50f71b369 100644
--- a/llvm/test/Transforms/NewGVN/opt-remarks-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/opt-remarks-xfail.ll
@@ -59,33 +59,33 @@
; YAML-NEXT: DebugLoc: { File: /tmp/s.c, Line: 2, Column: 10 }
; YAML-NEXT: ...
-define i32 @arg(i32* %p, i32 %i) {
+define i32 @arg(ptr %p, i32 %i) {
entry:
- store i32 %i, i32* %p
- %load = load i32, i32* %p
+ store i32 %i, ptr %p
+ %load = load i32, ptr %p
ret i32 %load
}
-define i32 @const(i32* %p) {
+define i32 @const(ptr %p) {
entry:
- store i32 4, i32* %p
- %load = load i32, i32* %p
+ store i32 4, ptr %p
+ %load = load i32, ptr %p
ret i32 %load
}
-define i32 @inst(i32* %p) {
+define i32 @inst(ptr %p) {
entry:
- %load1 = load i32, i32* %p
- %load = load i32, i32* %p
+ %load1 = load i32, ptr %p
+ %load = load i32, ptr %p
%add = add i32 %load1, %load
ret i32 %add
}
-define i32 @may_alias(i32* %p, i32* %r) !dbg !7 {
+define i32 @may_alias(ptr %p, ptr %r) !dbg !7 {
entry:
- %load1 = load i32, i32* %p, !tbaa !13, !dbg !9
- store i32 4, i32* %r, !tbaa !13, !dbg !10
- %load = load i32, i32* %p, !tbaa !13, !dbg !11
+ %load1 = load i32, ptr %p, !tbaa !13, !dbg !9
+ store i32 4, ptr %r, !tbaa !13, !dbg !10
+ %load = load i32, ptr %p, !tbaa !13, !dbg !11
%add = add i32 %load1, %load
ret i32 %add
}
diff --git a/llvm/test/Transforms/NewGVN/phi-of-ops-loads.ll b/llvm/test/Transforms/NewGVN/phi-of-ops-loads.ll
index ef1d2bc5693b..12c3389083cb 100644
--- a/llvm/test/Transforms/NewGVN/phi-of-ops-loads.ll
+++ b/llvm/test/Transforms/NewGVN/phi-of-ops-loads.ll
@@ -1,10 +1,10 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=newgvn -enable-phi-of-ops=true -S -o - %s | FileCheck %s
-define void @hoisted-load(i8* %p, i8* %q) {
+define void @hoisted-load(ptr %p, ptr %q) {
; CHECK-LABEL: @hoisted-load(
; CHECK-NEXT: bb56:
-; CHECK-NEXT: [[N60:%.*]] = load i8, i8* [[P:%.*]], align 1
+; CHECK-NEXT: [[N60:%.*]] = load i8, ptr [[P:%.*]], align 1
; CHECK-NEXT: br label [[BB57:%.*]]
; CHECK: bb57:
; CHECK-NEXT: [[PHIOFOPS:%.*]] = phi i1 [ true, [[BB56:%.*]] ], [ [[N62:%.*]], [[BB229:%.*]] ]
@@ -14,13 +14,13 @@ define void @hoisted-load(i8* %p, i8* %q) {
; CHECK-NEXT: br i1 [[PHIOFOPS]], label [[BB229]], label [[BB237:%.*]]
; CHECK: bb229:
; CHECK-NEXT: [[INC]] = add i8 [[IDX]], 1
-; CHECK-NEXT: store i8 [[INC]], i8* [[Q:%.*]], align 1
+; CHECK-NEXT: store i8 [[INC]], ptr [[Q:%.*]], align 1
; CHECK-NEXT: br label [[BB57]]
; CHECK: bb237:
; CHECK-NEXT: ret void
;
bb56:
- %n60 = load i8, i8* %p
+ %n60 = load i8, ptr %p
br label %bb57
bb57:
@@ -32,27 +32,27 @@ bb57:
bb229:
%inc = add i8 %idx, 1
- store i8 %inc, i8* %q
+ store i8 %inc, ptr %q
br label %bb57
bb237:
ret void
}
-define void @store-in-loop(i8* %p, i8* %q) {
+define void @store-in-loop(ptr %p, ptr %q) {
; CHECK-LABEL: @store-in-loop(
; CHECK-NEXT: bb56:
; CHECK-NEXT: br label [[BB57:%.*]]
; CHECK: bb57:
; CHECK-NEXT: [[N59:%.*]] = phi i1 [ false, [[BB229:%.*]] ], [ true, [[BB56:%.*]] ]
; CHECK-NEXT: [[IDX:%.*]] = phi i8 [ 0, [[BB56]] ], [ [[INC:%.*]], [[BB229]] ]
-; CHECK-NEXT: [[N60:%.*]] = load i8, i8* [[P:%.*]], align 1
+; CHECK-NEXT: [[N60:%.*]] = load i8, ptr [[P:%.*]], align 1
; CHECK-NEXT: [[N62:%.*]] = icmp ne i8 [[N60]], 2
; CHECK-NEXT: [[N63:%.*]] = or i1 [[N59]], [[N62]]
; CHECK-NEXT: br i1 [[N63]], label [[BB229]], label [[BB237:%.*]]
; CHECK: bb229:
; CHECK-NEXT: [[INC]] = add i8 [[IDX]], 1
-; CHECK-NEXT: store i8 [[INC]], i8* [[Q:%.*]], align 1
+; CHECK-NEXT: store i8 [[INC]], ptr [[Q:%.*]], align 1
; CHECK-NEXT: br label [[BB57]]
; CHECK: bb237:
; CHECK-NEXT: ret void
@@ -63,14 +63,14 @@ bb56:
bb57:
%n59 = phi i1 [ false, %bb229 ], [ true, %bb56 ]
%idx = phi i8 [0, %bb56], [%inc, %bb229]
- %n60 = load i8, i8* %p
+ %n60 = load i8, ptr %p
%n62 = icmp ne i8 %n60, 2
%n63 = or i1 %n59, %n62
br i1 %n63, label %bb229, label %bb237
bb229:
%inc = add i8 %idx, 1
- store i8 %inc, i8* %q
+ store i8 %inc, ptr %q
br label %bb57
bb237:
@@ -78,20 +78,20 @@ bb237:
}
; TODO: we should support this case
-define void @no-alias-store-in-loop(i8* noalias %p, i8* noalias %q) {
+define void @no-alias-store-in-loop(ptr noalias %p, ptr noalias %q) {
; CHECK-LABEL: @no-alias-store-in-loop(
; CHECK-NEXT: bb56:
; CHECK-NEXT: br label [[BB57:%.*]]
; CHECK: bb57:
; CHECK-NEXT: [[N59:%.*]] = phi i1 [ false, [[BB229:%.*]] ], [ true, [[BB56:%.*]] ]
; CHECK-NEXT: [[IDX:%.*]] = phi i8 [ 0, [[BB56]] ], [ [[INC:%.*]], [[BB229]] ]
-; CHECK-NEXT: [[N60:%.*]] = load i8, i8* [[P:%.*]], align 1
+; CHECK-NEXT: [[N60:%.*]] = load i8, ptr [[P:%.*]], align 1
; CHECK-NEXT: [[N62:%.*]] = icmp ne i8 [[N60]], 2
; CHECK-NEXT: [[N63:%.*]] = or i1 [[N59]], [[N62]]
; CHECK-NEXT: br i1 [[N63]], label [[BB229]], label [[BB237:%.*]]
; CHECK: bb229:
; CHECK-NEXT: [[INC]] = add i8 [[IDX]], 1
-; CHECK-NEXT: store i8 [[INC]], i8* [[Q:%.*]], align 1
+; CHECK-NEXT: store i8 [[INC]], ptr [[Q:%.*]], align 1
; CHECK-NEXT: br label [[BB57]]
; CHECK: bb237:
; CHECK-NEXT: ret void
@@ -102,27 +102,27 @@ bb56:
bb57:
%n59 = phi i1 [ false, %bb229 ], [ true, %bb56 ]
%idx = phi i8 [0, %bb56], [%inc, %bb229]
- %n60 = load i8, i8* %p
+ %n60 = load i8, ptr %p
%n62 = icmp ne i8 %n60, 2
%n63 = or i1 %n59, %n62
br i1 %n63, label %bb229, label %bb237
bb229:
%inc = add i8 %idx, 1
- store i8 %inc, i8* %q
+ store i8 %inc, ptr %q
br label %bb57
bb237:
ret void
}
-define void @function-in-loop(i8* %p) {
+define void @function-in-loop(ptr %p) {
; CHECK-LABEL: @function-in-loop(
; CHECK-NEXT: bb56:
; CHECK-NEXT: br label [[BB57:%.*]]
; CHECK: bb57:
; CHECK-NEXT: [[N59:%.*]] = phi i1 [ false, [[BB229:%.*]] ], [ true, [[BB56:%.*]] ]
-; CHECK-NEXT: [[N60:%.*]] = load i8, i8* [[P:%.*]], align 1
+; CHECK-NEXT: [[N60:%.*]] = load i8, ptr [[P:%.*]], align 1
; CHECK-NEXT: [[N62:%.*]] = icmp ne i8 [[N60]], 2
; CHECK-NEXT: [[N63:%.*]] = or i1 [[N59]], [[N62]]
; CHECK-NEXT: br i1 [[N63]], label [[BB229]], label [[BB237:%.*]]
@@ -137,7 +137,7 @@ bb56:
bb57:
%n59 = phi i1 [ false, %bb229 ], [ true, %bb56 ]
- %n60 = load i8, i8* %p
+ %n60 = load i8, ptr %p
%n62 = icmp ne i8 %n60, 2
%n63 = or i1 %n59, %n62
br i1 %n63, label %bb229, label %bb237
@@ -151,13 +151,13 @@ bb237:
}
; TODO: we should support this case
-define void @nowrite-function-in-loop(i8* %p) {
+define void @nowrite-function-in-loop(ptr %p) {
; CHECK-LABEL: @nowrite-function-in-loop(
; CHECK-NEXT: bb56:
; CHECK-NEXT: br label [[BB57:%.*]]
; CHECK: bb57:
; CHECK-NEXT: [[N59:%.*]] = phi i1 [ false, [[BB229:%.*]] ], [ true, [[BB56:%.*]] ]
-; CHECK-NEXT: [[N60:%.*]] = load i8, i8* [[P:%.*]], align 1
+; CHECK-NEXT: [[N60:%.*]] = load i8, ptr [[P:%.*]], align 1
; CHECK-NEXT: [[N62:%.*]] = icmp ne i8 [[N60]], 2
; CHECK-NEXT: [[N63:%.*]] = or i1 [[N59]], [[N62]]
; CHECK-NEXT: br i1 [[N63]], label [[BB229]], label [[BB237:%.*]]
@@ -172,7 +172,7 @@ bb56:
bb57:
%n59 = phi i1 [ false, %bb229 ], [ true, %bb56 ]
- %n60 = load i8, i8* %p
+ %n60 = load i8, ptr %p
%n62 = icmp ne i8 %n60, 2
%n63 = or i1 %n59, %n62
br i1 %n63, label %bb229, label %bb237
@@ -187,52 +187,52 @@ bb237:
declare void @f()
-define void @issfeoperand([3 x [2 x [1 x i8]]]* nocapture readonly %array, i1 %cond1, i1 %cond2, i16* nocapture readonly %p1, i32* nocapture writeonly %p2, i32* nocapture writeonly %p3) local_unnamed_addr #0 {
+define void @issfeoperand(ptr nocapture readonly %array, i1 %cond1, i1 %cond2, ptr nocapture readonly %p1, ptr nocapture writeonly %p2, ptr nocapture writeonly %p3) local_unnamed_addr #0 {
; CHECK-LABEL: @issfeoperand(
; CHECK-NEXT: for.body:
; CHECK-NEXT: br i1 [[COND1:%.*]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
; CHECK: cond.true:
-; CHECK-NEXT: [[ARRAYIDX31:%.*]] = getelementptr inbounds [3 x [2 x [1 x i8]]], [3 x [2 x [1 x i8]]]* [[ARRAY:%.*]], i64 109, i64 0, i64 0, i64 undef
-; CHECK-NEXT: [[LD1:%.*]] = load i8, i8* [[ARRAYIDX31]], align 1
+; CHECK-NEXT: [[ARRAYIDX31:%.*]] = getelementptr inbounds [3 x [2 x [1 x i8]]], ptr [[ARRAY:%.*]], i64 109, i64 0, i64 0, i64 undef
+; CHECK-NEXT: [[LD1:%.*]] = load i8, ptr [[ARRAYIDX31]], align 1
; CHECK-NEXT: br label [[COND_FALSE]]
; CHECK: cond.false:
; CHECK-NEXT: [[PHI1:%.*]] = phi i8 [ [[LD1]], [[COND_TRUE]] ], [ 0, [[FOR_BODY:%.*]] ]
-; CHECK-NEXT: [[ARRAYIDX42:%.*]] = getelementptr inbounds [3 x [2 x [1 x i8]]], [3 x [2 x [1 x i8]]]* [[ARRAY]], i64 109, i64 0, i64 0, i64 undef
-; CHECK-NEXT: [[LD2:%.*]] = load i8, i8* [[ARRAYIDX42]], align 1
+; CHECK-NEXT: [[ARRAYIDX42:%.*]] = getelementptr inbounds [3 x [2 x [1 x i8]]], ptr [[ARRAY]], i64 109, i64 0, i64 0, i64 undef
+; CHECK-NEXT: [[LD2:%.*]] = load i8, ptr [[ARRAYIDX42]], align 1
; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i8 [[LD2]], [[PHI1]]
; CHECK-NEXT: [[ZEXT:%.*]] = zext i1 [[CMP1]] to i32
-; CHECK-NEXT: store i32 [[ZEXT]], i32* [[P2:%.*]], align 4
+; CHECK-NEXT: store i32 [[ZEXT]], ptr [[P2:%.*]], align 4
; CHECK-NEXT: br i1 [[COND2:%.*]], label [[COND_END:%.*]], label [[EXIT:%.*]]
; CHECK: cond.end:
-; CHECK-NEXT: [[LD3:%.*]] = load i16, i16* [[P1:%.*]], align 2
+; CHECK-NEXT: [[LD3:%.*]] = load i16, ptr [[P1:%.*]], align 2
; CHECK-NEXT: [[SEXT:%.*]] = sext i16 [[LD3]] to i32
; CHECK-NEXT: br label [[EXIT]]
; CHECK: exit:
; CHECK-NEXT: [[PHI2:%.*]] = phi i32 [ [[SEXT]], [[COND_END]] ], [ 0, [[COND_FALSE]] ]
; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[LD2]], 0
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP2]], i32 [[PHI2]], i32 0
-; CHECK-NEXT: store i32 [[SEL]], i32* [[P3:%.*]], align 4
+; CHECK-NEXT: store i32 [[SEL]], ptr [[P3:%.*]], align 4
; CHECK-NEXT: ret void
;
for.body:
br i1 %cond1, label %cond.true, label %cond.false
cond.true: ; preds = %for.body
- %arrayidx31 = getelementptr inbounds [3 x [2 x [1 x i8]]], [3 x [2 x [1 x i8]]]* %array, i64 109, i64 0, i64 0, i64 undef
- %ld1 = load i8, i8* %arrayidx31, align 1
+ %arrayidx31 = getelementptr inbounds [3 x [2 x [1 x i8]]], ptr %array, i64 109, i64 0, i64 0, i64 undef
+ %ld1 = load i8, ptr %arrayidx31, align 1
br label %cond.false
cond.false: ; preds = %cond.true, %for.body
%phi1 = phi i8 [ %ld1, %cond.true ], [ 0, %for.body ]
- %arrayidx42 = getelementptr inbounds [3 x [2 x [1 x i8]]], [3 x [2 x [1 x i8]]]* %array, i64 109, i64 0, i64 0, i64 undef
- %ld2 = load i8, i8* %arrayidx42, align 1
+ %arrayidx42 = getelementptr inbounds [3 x [2 x [1 x i8]]], ptr %array, i64 109, i64 0, i64 0, i64 undef
+ %ld2 = load i8, ptr %arrayidx42, align 1
%cmp1 = icmp ult i8 %ld2, %phi1
%zext = zext i1 %cmp1 to i32
- store i32 %zext, i32* %p2, align 4
+ store i32 %zext, ptr %p2, align 4
br i1 %cond2, label %cond.end, label %exit
cond.end: ; preds = %cond.false
- %ld3 = load i16, i16* %p1, align 2
+ %ld3 = load i16, ptr %p1, align 2
%sext = sext i16 %ld3 to i32
br label %exit
@@ -240,6 +240,6 @@ exit: ; preds = %cond.end, %cond.fal
%phi2 = phi i32 [ %sext, %cond.end ], [ 0, %cond.false ]
%cmp2 = icmp eq i8 %ld2, 0
%sel = select i1 %cmp2, i32 %phi2, i32 0
- store i32 %sel, i32* %p3, align 4
+ store i32 %sel, ptr %p3, align 4
ret void
}
diff --git a/llvm/test/Transforms/NewGVN/phi-of-ops-move-block.ll b/llvm/test/Transforms/NewGVN/phi-of-ops-move-block.ll
index 32bcf3e5b7a5..db6693dd7ab7 100644
--- a/llvm/test/Transforms/NewGVN/phi-of-ops-move-block.ll
+++ b/llvm/test/Transforms/NewGVN/phi-of-ops-move-block.ll
@@ -9,11 +9,11 @@ define void @test() {
; CHECK-NEXT: br label [[BB1:%.*]]
; CHECK: bb1:
; CHECK-NEXT: [[STOREMERGE:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[ADD1:%.*]], [[CRITEDGE:%.*]] ]
-; CHECK-NEXT: store i32 [[STOREMERGE]], i32* @g_20, align 4
+; CHECK-NEXT: store i32 [[STOREMERGE]], ptr @g_20, align 4
; CHECK-NEXT: [[CMP0:%.*]] = icmp eq i32 [[STOREMERGE]], 0
; CHECK-NEXT: br i1 [[CMP0]], label [[LR_PH:%.*]], label [[CRITEDGE]]
; CHECK: lr.ph:
-; CHECK-NEXT: [[LV:%.*]] = load i64, i64* inttoptr (i64 16 to i64*), align 16
+; CHECK-NEXT: [[LV:%.*]] = load i64, ptr inttoptr (i64 16 to ptr), align 16
; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i64 [[LV]], 0
; CHECK-NEXT: br i1 [[CMP1]], label [[PREHEADER_SPLIT:%.*]], label [[CRITEDGE]]
; CHECK: preheader.split:
@@ -32,12 +32,12 @@ entry:
bb1: ; preds = %critedge, %entry
%storemerge = phi i32 [ 0, %entry ], [ %add1, %critedge ]
- store i32 %storemerge, i32* @g_20, align 4
+ store i32 %storemerge, ptr @g_20, align 4
%cmp0 = icmp eq i32 %storemerge, 0
br i1 %cmp0, label %lr.ph, label %critedge
lr.ph: ; preds = %bb1
- %lv = load i64, i64* inttoptr (i64 16 to i64*), align 16
+ %lv = load i64, ptr inttoptr (i64 16 to ptr), align 16
%cmp1 = icmp eq i64 %lv, 0
br i1 %cmp1, label %preheader.split, label %critedge
diff --git a/llvm/test/Transforms/NewGVN/phi-of-ops-simplification-dependencies.ll b/llvm/test/Transforms/NewGVN/phi-of-ops-simplification-dependencies.ll
index 93c2b8c74fcd..f2df0d8c5e5c 100644
--- a/llvm/test/Transforms/NewGVN/phi-of-ops-simplification-dependencies.ll
+++ b/llvm/test/Transforms/NewGVN/phi-of-ops-simplification-dependencies.ll
@@ -1,7 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=newgvn -S %s | FileCheck %s
-declare void @use.i16(i16*)
+declare void @use.i16(ptr)
declare void @use.i32(i32)
; Test cases from PR35074, where the simplification dependencies need to be
@@ -58,7 +58,7 @@ for.body4.1: ; preds = %for.body4
br label %for.end
}
-define void @test2(i1 %c, i16* %ptr, i64 %N) {
+define void @test2(i1 %c, ptr %ptr, i64 %N) {
; CHECK-LABEL: @test2(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[HEADER:%.*]]
@@ -71,12 +71,12 @@ define void @test2(i1 %c, i16* %ptr, i64 %N) {
; CHECK-NEXT: br i1 [[CMP1]], label [[LATCH]], label [[LOR_RHS:%.*]]
; CHECK: lor.rhs:
; CHECK-NEXT: [[IV_ADD_1:%.*]] = add i64 [[IV]], 1
-; CHECK-NEXT: [[IDX_1:%.*]] = getelementptr inbounds i16, i16* [[PTR:%.*]], i64 [[IV_ADD_1]]
-; CHECK-NEXT: call void @use.i16(i16* [[IDX_1]])
+; CHECK-NEXT: [[IDX_1:%.*]] = getelementptr inbounds i16, ptr [[PTR:%.*]], i64 [[IV_ADD_1]]
+; CHECK-NEXT: call void @use.i16(ptr [[IDX_1]])
; CHECK-NEXT: ret void
; CHECK: if.else:
-; CHECK-NEXT: [[IDX_2:%.*]] = getelementptr inbounds i16, i16* [[PTR]], i64 [[PHIOFOPS]]
-; CHECK-NEXT: call void @use.i16(i16* [[IDX_2]])
+; CHECK-NEXT: [[IDX_2:%.*]] = getelementptr inbounds i16, ptr [[PTR]], i64 [[PHIOFOPS]]
+; CHECK-NEXT: call void @use.i16(ptr [[IDX_2]])
; CHECK-NEXT: br label [[LATCH]]
; CHECK: latch:
; CHECK-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
@@ -98,14 +98,14 @@ if.then:
lor.rhs: ; preds = %if.then
%iv.add.1 = add i64 %iv, 1
- %idx.1 = getelementptr inbounds i16, i16* %ptr, i64 %iv.add.1
- call void @use.i16(i16* %idx.1)
+ %idx.1 = getelementptr inbounds i16, ptr %ptr, i64 %iv.add.1
+ call void @use.i16(ptr %idx.1)
ret void
if.else:
%iv.sub.1 = add i64 %iv, -1
- %idx.2 = getelementptr inbounds i16, i16* %ptr, i64 %iv.sub.1
- call void @use.i16(i16* %idx.2)
+ %idx.2 = getelementptr inbounds i16, ptr %ptr, i64 %iv.sub.1
+ call void @use.i16(ptr %idx.2)
br label %latch
latch:
@@ -117,7 +117,7 @@ exit:
ret void
}
-define void @pr49873_cmp_simplification_dependency(i32* %ptr, i1 %c.0) {
+define void @pr49873_cmp_simplification_dependency(ptr %ptr, i1 %c.0) {
; CHECK-LABEL: @pr49873_cmp_simplification_dependency(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP_1:%.*]]
@@ -126,7 +126,7 @@ define void @pr49873_cmp_simplification_dependency(i32* %ptr, i1 %c.0) {
; CHECK: loop.2:
; CHECK-NEXT: [[I130:%.*]] = phi i32 [ [[I132:%.*]], [[LOOP_2]] ], [ 0, [[LOOP_1]] ]
; CHECK-NEXT: [[I132]] = add nuw i32 [[I130]], 1
-; CHECK-NEXT: [[I133:%.*]] = load i32, i32* [[PTR:%.*]], align 4
+; CHECK-NEXT: [[I133:%.*]] = load i32, ptr [[PTR:%.*]], align 4
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i32 [[I132]], [[I133]]
; CHECK-NEXT: br i1 [[C_1]], label [[LOOP_2]], label [[LOOP_2_EXIT:%.*]]
; CHECK: loop.2.exit:
@@ -148,7 +148,7 @@ loop.1:
loop.2:
%i130 = phi i32 [ %i132, %loop.2 ], [ 0, %loop.1 ]
%i132 = add nuw i32 %i130, 1
- %i133 = load i32, i32* %ptr, align 4
+ %i133 = load i32, ptr %ptr, align 4
%c.1 = icmp ult i32 %i132, %i133
br i1 %c.1, label %loop.2, label %loop.2.exit
diff --git a/llvm/test/Transforms/NewGVN/phi-translate-partial-alias.ll b/llvm/test/Transforms/NewGVN/phi-translate-partial-alias.ll
index b2ba5791a053..cb24b050a599 100644
--- a/llvm/test/Transforms/NewGVN/phi-translate-partial-alias.ll
+++ b/llvm/test/Transforms/NewGVN/phi-translate-partial-alias.ll
@@ -6,21 +6,21 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
; not actually redundant around the loop backedge, despite appearances
; if phi-translation is ignored.
-; CHECK: define void @test0(i8* %begin)
+; CHECK: define void @test0(ptr %begin)
; CHECK: loop:
-; CHECK: %l0 = load i8, i8* %phi
+; CHECK: %l0 = load i8, ptr %phi
; CHECK: call void @bar(i8 %l0)
-; CHECK: %l1 = load i8, i8* %phi
-define void @test0(i8* %begin) {
+; CHECK: %l1 = load i8, ptr %phi
+define void @test0(ptr %begin) {
entry:
br label %loop
loop:
- %phi = phi i8* [ %begin, %entry ], [ %next, %loop ]
- %l0 = load i8, i8* %phi
+ %phi = phi ptr [ %begin, %entry ], [ %next, %loop ]
+ %l0 = load i8, ptr %phi
call void @bar(i8 %l0)
- %l1 = load i8, i8* %phi
- %next = getelementptr inbounds i8, i8* %phi, i8 %l1
+ %l1 = load i8, ptr %phi
+ %next = getelementptr inbounds i8, ptr %phi, i8 %l1
br label %loop
}
diff --git a/llvm/test/Transforms/NewGVN/pr10820-xfail.ll b/llvm/test/Transforms/NewGVN/pr10820-xfail.ll
index f4daa6e563d4..a986ca5f2591 100644
--- a/llvm/test/Transforms/NewGVN/pr10820-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/pr10820-xfail.ll
@@ -10,10 +10,10 @@ target triple = "x86_64-unknown-linux-gnu"
define void @main() nounwind uwtable {
entry:
; CHECK: store i32
- store i32 402662078, i32* bitcast (i31* @g to i32*), align 8
+ store i32 402662078, ptr @g, align 8
; CHECK-NOT: load i31
- %0 = load i31, i31* @g, align 8
+ %0 = load i31, ptr @g, align 8
; CHECK: store i31
- store i31 %0, i31* undef, align 1
+ store i31 %0, ptr undef, align 1
unreachable
}
diff --git a/llvm/test/Transforms/NewGVN/pr14166-xfail.ll b/llvm/test/Transforms/NewGVN/pr14166-xfail.ll
index 8418c5b4cc6e..1e722361d7c5 100644
--- a/llvm/test/Transforms/NewGVN/pr14166-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/pr14166-xfail.ll
@@ -5,22 +5,20 @@ target datalayout = "e-p:32:32:32"
target triple = "i386-pc-linux-gnu"
define <2 x i32> @test1() {
%v1 = alloca <2 x i32>
- call void @anything(<2 x i32>* %v1)
- %v2 = load <2 x i32>, <2 x i32>* %v1
- %v3 = inttoptr <2 x i32> %v2 to <2 x i8*>
- %v4 = bitcast <2 x i32>* %v1 to <2 x i8*>*
- store <2 x i8*> %v3, <2 x i8*>* %v4
- %v5 = load <2 x i32>, <2 x i32>* %v1
+ call void @anything(ptr %v1)
+ %v2 = load <2 x i32>, ptr %v1
+ %v3 = inttoptr <2 x i32> %v2 to <2 x ptr>
+ store <2 x ptr> %v3, ptr %v1
+ %v5 = load <2 x i32>, ptr %v1
ret <2 x i32> %v5
; CHECK-LABEL: @test1(
; CHECK: %v1 = alloca <2 x i32>
-; CHECK: call void @anything(<2 x i32>* %v1)
-; CHECK: %v2 = load <2 x i32>, <2 x i32>* %v1
-; CHECK: %v3 = inttoptr <2 x i32> %v2 to <2 x i8*>
-; CHECK: %v4 = bitcast <2 x i32>* %v1 to <2 x i8*>*
-; CHECK: store <2 x i8*> %v3, <2 x i8*>* %v4
+; CHECK: call void @anything(ptr %v1)
+; CHECK: %v2 = load <2 x i32>, ptr %v1
+; CHECK: %v3 = inttoptr <2 x i32> %v2 to <2 x ptr>
+; CHECK: store <2 x ptr> %v3, ptr %v1
; CHECK: ret <2 x i32> %v2
}
-declare void @anything(<2 x i32>*)
+declare void @anything(ptr)
diff --git a/llvm/test/Transforms/NewGVN/pr17732.ll b/llvm/test/Transforms/NewGVN/pr17732.ll
index 1a4e13301f57..6d26035ce45e 100644
--- a/llvm/test/Transforms/NewGVN/pr17732.ll
+++ b/llvm/test/Transforms/NewGVN/pr17732.ll
@@ -13,11 +13,11 @@ target triple = "x86_64-unknown-linux-gnu"
define i32 @main() {
entry:
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 getelementptr inbounds (%struct.with_array, %struct.with_array* @array_with_zeroinit, i64 0, i32 0, i64 0), i8* align 4 getelementptr inbounds ({ [2 x i8], i32, i8, [3 x i8] }, { [2 x i8], i32, i8, [3 x i8] }* @main.obj_with_array, i64 0, i32 0, i64 0), i64 12, i1 false)
- %0 = load i8, i8* getelementptr inbounds (%struct.with_array, %struct.with_array* @array_with_zeroinit, i64 0, i32 2), align 4
+ tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 @array_with_zeroinit, ptr align 4 getelementptr inbounds ({ [2 x i8], i32, i8, [3 x i8] }, ptr @main.obj_with_array, i64 0, i32 0, i64 0), i64 12, i1 false)
+ %0 = load i8, ptr getelementptr inbounds (%struct.with_array, ptr @array_with_zeroinit, i64 0, i32 2), align 4
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 getelementptr inbounds (%struct.with_vector, %struct.with_vector* @vector_with_zeroinit, i64 0, i32 0, i64 0), i8* align 4 getelementptr inbounds ({ <2 x i8>, i32, i8, [3 x i8] }, { <2 x i8>, i32, i8, [3 x i8] }* @main.obj_with_vector, i64 0, i32 0, i64 0), i64 12, i1 false)
- %1 = load i8, i8* getelementptr inbounds (%struct.with_vector, %struct.with_vector* @vector_with_zeroinit, i64 0, i32 2), align 4
+ tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 @vector_with_zeroinit, ptr align 4 getelementptr inbounds ({ <2 x i8>, i32, i8, [3 x i8] }, ptr @main.obj_with_vector, i64 0, i32 0, i64 0), i64 12, i1 false)
+ %1 = load i8, ptr getelementptr inbounds (%struct.with_vector, ptr @vector_with_zeroinit, i64 0, i32 2), align 4
%conv0 = sext i8 %0 to i32
%conv1 = sext i8 %1 to i32
%and = and i32 %conv0, %conv1
@@ -26,4 +26,4 @@ entry:
; CHECK: ret i32 1
}
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture readonly, i64, i1)
diff --git a/llvm/test/Transforms/NewGVN/pr17852.ll b/llvm/test/Transforms/NewGVN/pr17852.ll
index db651a75924c..5858982ce1cd 100644
--- a/llvm/test/Transforms/NewGVN/pr17852.ll
+++ b/llvm/test/Transforms/NewGVN/pr17852.ll
@@ -1,64 +1,56 @@
; RUN: opt < %s -passes=newgvn
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
%struct.S0 = type { [2 x i8], [2 x i8], [4 x i8], [2 x i8], i32, i32, i32, i32 }
-define void @fn1(%struct.S0* byval(%struct.S0) align 8 %p1) {
+define void @fn1(ptr byval(%struct.S0) align 8 %p1) {
br label %for.cond
for.cond: ; preds = %1, %0
br label %for.end
- %f2 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 2
- %f9 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 7
+ %f2 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 2
+ %f9 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 7
br label %for.cond
for.end: ; preds = %for.cond
br i1 true, label %if.else, label %if.then
if.then: ; preds = %for.end
- %f22 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 2
- %f7 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 5
- %tmp7 = load i32, i32* %f7, align 8
+ %f22 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 2
+ %f7 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 5
+ %tmp7 = load i32, ptr %f7, align 8
br label %if.end40
if.else: ; preds = %for.end
br i1 false, label %for.cond18, label %if.then6
if.then6: ; preds = %if.else
- %f3 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 2
- %tmp10 = bitcast %struct.S0* %p1 to i16*
- %f5 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 3
- %tmp11 = bitcast [2 x i8]* %f5 to i16*
- %bf.load13 = load i16, i16* %tmp11, align 8
+ %f3 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 2
+ %f5 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 3
+ %bf.load13 = load i16, ptr %f5, align 8
br label %if.end36
for.cond18: ; preds = %if.else
call void @fn4()
br i1 true, label %if.end, label %if.end36
if.end: ; preds = %for.cond18
- %f321 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 2
- %f925 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 7
- %f526 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 3
- %tmp15 = bitcast [2 x i8]* %f526 to i16*
- %bf.load27 = load i16, i16* %tmp15, align 8
- %tmp16 = bitcast %struct.S0* %p1 to i16*
+ %f321 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 2
+ %f925 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 7
+ %f526 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 3
+ %bf.load27 = load i16, ptr %f526, align 8
br label %if.end36
if.end36: ; preds = %if.end, %for.cond18, %if.then6
- %f537 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 3
- %tmp17 = bitcast [2 x i8]* %f537 to i16*
- %bf.load38 = load i16, i16* %tmp17, align 8
+ %f537 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 3
+ %bf.load38 = load i16, ptr %f537, align 8
%bf.clear39 = and i16 %bf.load38, -16384
br label %if.end40
if.end40: ; preds = %if.end36, %if.then
- %f6 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 4
- %tmp18 = load i32, i32* %f6, align 4
+ %f6 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 4
+ %tmp18 = load i32, ptr %f6, align 4
call void @fn2(i32 %tmp18)
- %f8 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 6
- %tmp19 = load i32, i32* %f8, align 4
+ %f8 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 6
+ %tmp19 = load i32, ptr %f8, align 4
%tobool41 = icmp eq i32 %tmp19, 0
br i1 true, label %if.end50, label %if.then42
if.then42: ; preds = %if.end40
- %tmp20 = bitcast %struct.S0* %p1 to i16*
- %f547 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 3
- %tmp21 = bitcast [2 x i8]* %f547 to i16*
- %bf.load48 = load i16, i16* %tmp21, align 8
+ %f547 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 3
+ %bf.load48 = load i16, ptr %f547, align 8
br label %if.end50
if.end50: ; preds = %if.then42, %if.end40
- %f551 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 3
- %tmp22 = bitcast [2 x i8]* %f551 to i16*
- %bf.load52 = load i16, i16* %tmp22, align 8
+ %f551 = getelementptr inbounds %struct.S0, ptr %p1, i64 0, i32 3
+ %bf.load52 = load i16, ptr %f551, align 8
%bf.clear53 = and i16 %bf.load52, -16384
ret void
}
diff --git a/llvm/test/Transforms/NewGVN/pr24397.ll b/llvm/test/Transforms/NewGVN/pr24397.ll
index 6e77a157612e..f3f112ae1fe3 100644
--- a/llvm/test/Transforms/NewGVN/pr24397.ll
+++ b/llvm/test/Transforms/NewGVN/pr24397.ll
@@ -2,17 +2,16 @@
target triple = "x86_64-unknown-linux-gnu"
-define i64 @foo(i64** %arrayidx) {
+define i64 @foo(ptr %arrayidx) {
entry:
- %p = load i64*, i64** %arrayidx, align 8
- %cmpnull = icmp eq i64* %p, null
+ %p = load ptr, ptr %arrayidx, align 8
+ %cmpnull = icmp eq ptr %p, null
br label %BB2
entry2: ; No predecessors!
br label %BB2
BB2: ; preds = %entry2, %entry
- %bc = bitcast i64** %arrayidx to i64*
- %load = load i64, i64* %bc, align 8
+ %load = load i64, ptr %arrayidx, align 8
ret i64 %load
}
diff --git a/llvm/test/Transforms/NewGVN/pr24426.ll b/llvm/test/Transforms/NewGVN/pr24426.ll
index 5100c1016abc..e8a88f5b267a 100644
--- a/llvm/test/Transforms/NewGVN/pr24426.ll
+++ b/llvm/test/Transforms/NewGVN/pr24426.ll
@@ -2,16 +2,15 @@
declare void @check(i8)
-declare void @write(i8* %res)
+declare void @write(ptr %res)
define void @test1() {
%1 = alloca [10 x i8]
- %2 = bitcast [10 x i8]* %1 to i8*
- call void @write(i8* %2)
- %3 = load i8, i8* %2
+ call void @write(ptr %1)
+ %2 = load i8, ptr %1
; CHECK-NOT: undef
- call void @check(i8 %3)
+ call void @check(i8 %2)
ret void
}
diff --git a/llvm/test/Transforms/NewGVN/pr25440.ll b/llvm/test/Transforms/NewGVN/pr25440.ll
index 22502c465b3a..b3ebf447afc2 100644
--- a/llvm/test/Transforms/NewGVN/pr25440.ll
+++ b/llvm/test/Transforms/NewGVN/pr25440.ll
@@ -9,17 +9,16 @@ target triple = "thumbv7--linux-gnueabi"
@length = external global [0 x i32], align 4
; Function Attrs: nounwind
-define fastcc void @foo(%struct.a* nocapture readonly %x) {
+define fastcc void @foo(ptr nocapture readonly %x) {
;CHECK-LABEL: foo
entry:
br label %bb0
bb0: ; preds = %land.lhs.true, %entry
;CHECK: bb0:
- %x.tr = phi %struct.a* [ %x, %entry ], [ null, %land.lhs.true ]
- %code1 = getelementptr inbounds %struct.a, %struct.a* %x.tr, i32 0, i32 0
- %0 = load i16, i16* %code1, align 4
-; CHECK: load i16, i16*
+ %x.tr = phi ptr [ %x, %entry ], [ null, %land.lhs.true ]
+ %0 = load i16, ptr %x.tr, align 4
+; CHECK: load i16, ptr
%conv = zext i16 %0 to i32
switch i32 %conv, label %if.end.50 [
i32 43, label %cleanup
@@ -33,14 +32,14 @@ land.lhs.true: ; preds = %if.then.5
br i1 undef, label %cleanup, label %bb0
if.then.26: ; preds = %if.then.5
- %x.tr.lcssa163 = phi %struct.a* [ %x.tr, %if.then.5 ]
+ %x.tr.lcssa163 = phi ptr [ %x.tr, %if.then.5 ]
br i1 undef, label %cond.end, label %cond.false
cond.false: ; preds = %if.then.26
; CHECK: cond.false:
; CHECK: load i16
- %mode = getelementptr inbounds %struct.a, %struct.a* %x.tr.lcssa163, i32 0, i32 1
- %bf.load = load i16, i16* %mode, align 2
+ %mode = getelementptr inbounds %struct.a, ptr %x.tr.lcssa163, i32 0, i32 1
+ %bf.load = load i16, ptr %mode, align 2
%bf.shl = shl i16 %bf.load, 8
br label %cond.end
@@ -53,8 +52,8 @@ if.then.44: ; preds = %cond.end
if.end.50: ; preds = %bb0
;%CHECK: if.end.50:
%conv.lcssa = phi i32 [ %conv, %bb0 ]
- %arrayidx52 = getelementptr inbounds [0 x i32], [0 x i32]* @length, i32 0, i32 %conv.lcssa
- %1 = load i32, i32* %arrayidx52, align 4
+ %arrayidx52 = getelementptr inbounds [0 x i32], ptr @length, i32 0, i32 %conv.lcssa
+ %1 = load i32, ptr %arrayidx52, align 4
br i1 undef, label %for.body.57, label %cleanup
for.body.57: ; preds = %if.end.50
@@ -65,8 +64,8 @@ cleanup: ; preds = %if.end.50, %cond.en
ret void
}
- at yy_c_buf_p = external unnamed_addr global i8*, align 4
- at dfg_text = external global i8*, align 4
+ at yy_c_buf_p = external unnamed_addr global ptr, align 4
+ at dfg_text = external global ptr, align 4
define void @dfg_lex() {
;CHECK-LABEL: dfg_lex
@@ -77,21 +76,21 @@ while.bodythread-pre-split: ; preds = %while.end, %while.e
br i1 undef, label %if.then.14, label %if.end.15
if.then.14: ; preds = %while.end, %while.bodythread-pre-split
- %v1 = load i32, i32* bitcast (i8** @dfg_text to i32*), align 4
+ %v1 = load i32, ptr @dfg_text, align 4
%sub.ptr.sub = sub i32 undef, %v1
br label %if.end.15
if.end.15: ; preds = %if.then.14, %while.bodythread-pre-split
- %v2 = load i8*, i8** @yy_c_buf_p, align 4
+ %v2 = load ptr, ptr @yy_c_buf_p, align 4
br label %while.cond.16
while.cond.16: ; preds = %while.cond.16, %if.end.15
br i1 undef, label %while.cond.16, label %while.end
while.end: ; preds = %while.cond.16
- %add.ptr = getelementptr inbounds i8, i8* %v2, i32 undef
- store i8* %add.ptr, i8** @dfg_text, align 4
- %sub.ptr.rhs.cast25 = ptrtoint i8* %add.ptr to i32
+ %add.ptr = getelementptr inbounds i8, ptr %v2, i32 undef
+ store ptr %add.ptr, ptr @dfg_text, align 4
+ %sub.ptr.rhs.cast25 = ptrtoint ptr %add.ptr to i32
%sub.ptr.sub26 = sub i32 0, %sub.ptr.rhs.cast25
switch i32 undef, label %sw.default [
i32 65, label %while.bodythread-pre-split
diff --git a/llvm/test/Transforms/NewGVN/pr28562.ll b/llvm/test/Transforms/NewGVN/pr28562.ll
index b042a8505d78..a62fdd31da72 100644
--- a/llvm/test/Transforms/NewGVN/pr28562.ll
+++ b/llvm/test/Transforms/NewGVN/pr28562.ll
@@ -1,9 +1,9 @@
; RUN: opt -S -passes=newgvn < %s | FileCheck %s
-define i32* @test1(i32* %a) {
- %x1 = getelementptr inbounds i32, i32* %a, i32 10
- %x2 = getelementptr i32, i32* %a, i32 10
- ret i32* %x2
+define ptr @test1(ptr %a) {
+ %x1 = getelementptr inbounds i32, ptr %a, i32 10
+ %x2 = getelementptr i32, ptr %a, i32 10
+ ret ptr %x2
; CHECK-LABEL: @test1(
-; CHECK: %[[x:.*]] = getelementptr i32, i32* %a, i32 10
-; CHECK: ret i32* %[[x]]
+; CHECK: %[[x:.*]] = getelementptr i32, ptr %a, i32 10
+; CHECK: ret ptr %[[x]]
}
diff --git a/llvm/test/Transforms/NewGVN/pr31472.ll b/llvm/test/Transforms/NewGVN/pr31472.ll
index 9a07b3dda7ab..8bb9a14e8136 100644
--- a/llvm/test/Transforms/NewGVN/pr31472.ll
+++ b/llvm/test/Transforms/NewGVN/pr31472.ll
@@ -6,14 +6,14 @@ target triple = "x86_64-apple-macosx10.12.0"
;; Ensure the invoke does not accidentally get deleted as unused, just because the value is not used.
; Function Attrs: norecurse ssp uwtable
-define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*){
+define i32 @main() personality ptr @__gxx_personality_v0{
; CHECK-LABEL: @main(
; CHECK-NEXT: [[TMP1:%.*]] = invoke i32 @foo()
; CHECK-NEXT: to label %good unwind label %bad
; CHECK: good:
; CHECK-NEXT: ret i32 5
; CHECK: bad:
-; CHECK-NEXT: [[TMP2:%.*]] = landingpad { i8*, i32
+; CHECK-NEXT: [[TMP2:%.*]] = landingpad { ptr, i32
;
%1 = invoke i32 @foo()
to label %good unwind label %bad
@@ -25,9 +25,9 @@ good:
bad:
; <label>:20: ; preds = %15, %.preheader
- %2 = landingpad { i8*, i32 }
+ %2 = landingpad { ptr, i32 }
cleanup
- resume { i8*, i32 } %2
+ resume { ptr, i32 } %2
}
declare i32 @foo()
diff --git a/llvm/test/Transforms/NewGVN/pr31483.ll b/llvm/test/Transforms/NewGVN/pr31483.ll
index fc5e64d11249..fe957dec72cf 100644
--- a/llvm/test/Transforms/NewGVN/pr31483.ll
+++ b/llvm/test/Transforms/NewGVN/pr31483.ll
@@ -6,19 +6,19 @@ target datalayout = "E-m:e-i64:64-n32:64"
;; Ensure we do not believe the indexing increments are unreachable due to incorrect memory
;; equivalence detection. In PR31483, we were deleting those blocks as unreachable
; Function Attrs: nounwind
-define signext i32 @ham(i8* %arg, i8* %arg1) #0 {
+define signext i32 @ham(ptr %arg, ptr %arg1) #0 {
; CHECK-LABEL: @ham(
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[TMP:%.*]] = alloca i8*, align 8
-; CHECK-NEXT: store i8* %arg1, i8** [[TMP]], align 8
+; CHECK-NEXT: [[TMP:%.*]] = alloca ptr, align 8
+; CHECK-NEXT: store ptr %arg1, ptr [[TMP]], align 8
; CHECK-NEXT: br label %bb2
; CHECK: bb2:
-; CHECK-NEXT: [[TMP3:%.*]] = phi i8* [ %arg, %bb ], [ %tmp7, %bb22 ]
-; CHECK-NEXT: [[TMP4:%.*]] = load i8, i8* [[TMP3]], align 1
+; CHECK-NEXT: [[TMP3:%.*]] = phi ptr [ %arg, %bb ], [ %tmp7, %bb22 ]
+; CHECK-NEXT: [[TMP4:%.*]] = load i8, ptr [[TMP3]], align 1
; CHECK-NEXT: [[TMP5:%.*]] = icmp ne i8 [[TMP4]], 0
; CHECK-NEXT: br i1 [[TMP5]], label %bb6, label %bb23
; CHECK: bb6:
-; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i8, i8* [[TMP3]], i32 1
+; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i8, ptr [[TMP3]], i32 1
; CHECK-NEXT: [[TMP9:%.*]] = zext i8 [[TMP4]] to i32
; CHECK-NEXT: switch i32 [[TMP9]], label %bb22 [
; CHECK-NEXT: i32 115, label %bb10
@@ -26,41 +26,38 @@ define signext i32 @ham(i8* %arg, i8* %arg1) #0 {
; CHECK-NEXT: i32 99, label %bb16
; CHECK-NEXT: ]
; CHECK: bb10:
-; CHECK-NEXT: [[TMP11:%.*]] = load i8*, i8** [[TMP]], align 8
-; CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds i8, i8* [[TMP11]], i64 8
-; CHECK-NEXT: store i8* [[TMP12]], i8** [[TMP]], align 8
-; CHECK-NEXT: [[TMP13:%.*]] = bitcast i8* [[TMP11]] to i8**
-; CHECK-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 8
-; CHECK-NEXT: [[TMP15:%.*]] = call signext i32 (i8*, ...) @zot(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @global, i32 0, i32 0), i8* [[TMP14]])
+; CHECK-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP]], align 8
+; CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds i8, ptr [[TMP11]], i64 8
+; CHECK-NEXT: store ptr [[TMP12]], ptr [[TMP]], align 8
+; CHECK-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP11]], align 8
+; CHECK-NEXT: [[TMP15:%.*]] = call signext i32 (ptr, ...) @zot(ptr @global, ptr [[TMP14]])
; CHECK-NEXT: br label %bb22
; CHECK: bb16:
-; CHECK-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP]], align 8
-; CHECK-NEXT: [[TMP18:%.*]] = getelementptr inbounds i8, i8* [[TMP17]], i64 8
-; CHECK-NEXT: store i8* [[TMP18]], i8** [[TMP]], align 8
-; CHECK-NEXT: [[TMP19:%.*]] = getelementptr inbounds i8, i8* [[TMP17]], i64 4
-; CHECK-NEXT: [[TMP20:%.*]] = bitcast i8* [[TMP19]] to i32*
+; CHECK-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP]], align 8
+; CHECK-NEXT: [[TMP18:%.*]] = getelementptr inbounds i8, ptr [[TMP17]], i64 8
+; CHECK-NEXT: store ptr [[TMP18]], ptr [[TMP]], align 8
+; CHECK-NEXT: [[TMP19:%.*]] = getelementptr inbounds i8, ptr [[TMP17]], i64 4
; CHECK-NEXT: br label %bb22
; CHECK: bb22:
; CHECK-NEXT: br label %bb2
; CHECK: bb23:
-; CHECK-NEXT: [[TMP24:%.*]] = bitcast i8** [[TMP]] to i8*
-; CHECK-NEXT: call void @llvm.va_end(i8* [[TMP24]])
+; CHECK-NEXT: call void @llvm.va_end(ptr [[TMP]])
; CHECK-NEXT: ret i32 undef
;
bb:
- %tmp = alloca i8*, align 8
- store i8* %arg1, i8** %tmp, align 8
+ %tmp = alloca ptr, align 8
+ store ptr %arg1, ptr %tmp, align 8
br label %bb2
bb2: ; preds = %bb22, %bb
- %tmp3 = phi i8* [ %arg, %bb ], [ %tmp7, %bb22 ]
- %tmp4 = load i8, i8* %tmp3, align 1
+ %tmp3 = phi ptr [ %arg, %bb ], [ %tmp7, %bb22 ]
+ %tmp4 = load i8, ptr %tmp3, align 1
%tmp5 = icmp ne i8 %tmp4, 0
br i1 %tmp5, label %bb6, label %bb23
bb6: ; preds = %bb2
- %tmp7 = getelementptr inbounds i8, i8* %tmp3, i32 1
- %tmp8 = load i8, i8* %tmp3, align 1
+ %tmp7 = getelementptr inbounds i8, ptr %tmp3, i32 1
+ %tmp8 = load i8, ptr %tmp3, align 1
%tmp9 = zext i8 %tmp8 to i32
switch i32 %tmp9, label %bb22 [
i32 115, label %bb10
@@ -69,36 +66,33 @@ bb6: ; preds = %bb2
]
bb10: ; preds = %bb6
- %tmp11 = load i8*, i8** %tmp, align 8
- %tmp12 = getelementptr inbounds i8, i8* %tmp11, i64 8
- store i8* %tmp12, i8** %tmp, align 8
- %tmp13 = bitcast i8* %tmp11 to i8**
- %tmp14 = load i8*, i8** %tmp13, align 8
- %tmp15 = call signext i32 (i8*, ...) @zot(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @global, i32 0, i32 0), i8* %tmp14)
+ %tmp11 = load ptr, ptr %tmp, align 8
+ %tmp12 = getelementptr inbounds i8, ptr %tmp11, i64 8
+ store ptr %tmp12, ptr %tmp, align 8
+ %tmp14 = load ptr, ptr %tmp11, align 8
+ %tmp15 = call signext i32 (ptr, ...) @zot(ptr @global, ptr %tmp14)
br label %bb22
bb16: ; preds = %bb6, %bb6
- %tmp17 = load i8*, i8** %tmp, align 8
- %tmp18 = getelementptr inbounds i8, i8* %tmp17, i64 8
- store i8* %tmp18, i8** %tmp, align 8
- %tmp19 = getelementptr inbounds i8, i8* %tmp17, i64 4
- %tmp20 = bitcast i8* %tmp19 to i32*
- %tmp21 = load i32, i32* %tmp20, align 4
+ %tmp17 = load ptr, ptr %tmp, align 8
+ %tmp18 = getelementptr inbounds i8, ptr %tmp17, i64 8
+ store ptr %tmp18, ptr %tmp, align 8
+ %tmp19 = getelementptr inbounds i8, ptr %tmp17, i64 4
+ %tmp21 = load i32, ptr %tmp19, align 4
br label %bb22
bb22: ; preds = %bb16, %bb10, %bb6
br label %bb2
bb23: ; preds = %bb2
- %tmp24 = bitcast i8** %tmp to i8*
- call void @llvm.va_end(i8* %tmp24)
+ call void @llvm.va_end(ptr %tmp)
ret i32 undef
}
-declare signext i32 @zot(i8*, ...) #1
+declare signext i32 @zot(ptr, ...) #1
; Function Attrs: nounwind
-declare void @llvm.va_end(i8*) #2
+declare void @llvm.va_end(ptr) #2
attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="ppc64" "target-features"="+altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="ppc64" "target-features"="+altivec,-bpermd,-crypto,-direct-move,-extdiv,-power8-vector,-vsx" "unsafe-fp-math"="false" "use-soft-float"="false" }
diff --git a/llvm/test/Transforms/NewGVN/pr31491.ll b/llvm/test/Transforms/NewGVN/pr31491.ll
index bbd7b16088fe..5f6b371333bb 100644
--- a/llvm/test/Transforms/NewGVN/pr31491.ll
+++ b/llvm/test/Transforms/NewGVN/pr31491.ll
@@ -9,22 +9,22 @@ define internal i32 @pr31491() {
; CHECK-NEXT: bb5:
; CHECK-NEXT: br label %bb7
; CHECK: bb7:
-; CHECK-NEXT: [[TMP:%.*]] = phi i8* [ [[TMP:%.*]]11, %bb10 ], [ undef, %bb5 ]
+; CHECK-NEXT: [[TMP:%.*]] = phi ptr [ [[TMP:%.*]]11, %bb10 ], [ undef, %bb5 ]
; CHECK-NEXT: br label %bb10
; CHECK: bb10:
-; CHECK-NEXT: [[TMP11:%.*]] = tail call i8* @patatino(i8* [[TMP]])
+; CHECK-NEXT: [[TMP11:%.*]] = tail call ptr @patatino(ptr [[TMP]])
; CHECK-NEXT: br label %bb7
;
bb5:
br label %bb7
bb7: ; preds = %bb10, %bb5
- %tmp = phi i8* [ %tmp11, %bb10 ], [ undef, %bb5 ]
+ %tmp = phi ptr [ %tmp11, %bb10 ], [ undef, %bb5 ]
br label %bb10
bb10: ; preds = %bb7
- %tmp11 = tail call i8* @patatino(i8* %tmp)
+ %tmp11 = tail call ptr @patatino(ptr %tmp)
br label %bb7
}
-declare i8* @patatino(i8*)
+declare ptr @patatino(ptr)
diff --git a/llvm/test/Transforms/NewGVN/pr31501.ll b/llvm/test/Transforms/NewGVN/pr31501.ll
index ba9257d40e99..55195fd6ada7 100644
--- a/llvm/test/Transforms/NewGVN/pr31501.ll
+++ b/llvm/test/Transforms/NewGVN/pr31501.ll
@@ -2,14 +2,14 @@
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-%struct.foo = type { %struct.wombat.28*, %struct.zot, %struct.wombat.28* }
+%struct.foo = type { ptr, %struct.zot, ptr }
%struct.zot = type { i64 }
-%struct.barney = type <{ %struct.wombat.28*, %struct.wibble, %struct.snork, %struct.quux.4, %struct.snork.10, %struct.ham.16*, %struct.wobble.23*, i32, i8, i8, [2 x i8] }>
+%struct.barney = type <{ ptr, %struct.wibble, %struct.snork, %struct.quux.4, %struct.snork.10, ptr, ptr, i32, i8, i8, [2 x i8] }>
%struct.wibble = type { %struct.pluto, %struct.bar }
%struct.pluto = type { %struct.quux }
%struct.quux = type { %struct.eggs }
%struct.eggs = type { %struct.zot.0, %struct.widget }
-%struct.zot.0 = type { i8*, i8*, i8* }
+%struct.zot.0 = type { ptr, ptr, ptr }
%struct.widget = type { %struct.barney.1 }
%struct.barney.1 = type { [8 x i8] }
%struct.bar = type { [3 x %struct.widget] }
@@ -34,87 +34,81 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
%struct.spam.15 = type { i8 }
%struct.ham.16 = type { %struct.pluto.17, %struct.pluto.17 }
%struct.pluto.17 = type { %struct.bar.18 }
-%struct.bar.18 = type { %struct.baz*, %struct.zot.20, %struct.barney.22 }
-%struct.baz = type { %struct.wibble.19* }
-%struct.wibble.19 = type <{ %struct.baz, %struct.wibble.19*, %struct.baz*, i8, [7 x i8] }>
+%struct.bar.18 = type { ptr, %struct.zot.20, %struct.barney.22 }
+%struct.baz = type { ptr }
+%struct.wibble.19 = type <{ %struct.baz, ptr, ptr, i8, [7 x i8] }>
%struct.zot.20 = type { %struct.ham.21 }
%struct.ham.21 = type { %struct.baz }
%struct.barney.22 = type { %struct.blam }
%struct.blam = type { i64 }
-%struct.wobble.23 = type { %struct.spam.24, %struct.barney* }
-%struct.spam.24 = type { %struct.bar.25, %struct.zot.26* }
-%struct.bar.25 = type <{ i32 (...)**, i8, i8 }>
-%struct.zot.26 = type { i32 (...)**, i32, %struct.widget.27* }
-%struct.widget.27 = type { %struct.zot.26, %struct.zot.26* }
-%struct.wombat.28 = type <{ i32 (...)**, i8, i8, [6 x i8] }>
+%struct.wobble.23 = type { %struct.spam.24, ptr }
+%struct.spam.24 = type { %struct.bar.25, ptr }
+%struct.bar.25 = type <{ ptr, i8, i8 }>
+%struct.zot.26 = type { ptr, i32, ptr }
+%struct.widget.27 = type { %struct.zot.26, ptr }
+%struct.wombat.28 = type <{ ptr, i8, i8, [6 x i8] }>
; Function Attrs: norecurse nounwind ssp uwtable
-define weak_odr hidden %struct.foo* @quux(%struct.barney* %arg, %struct.wombat.28* %arg1) local_unnamed_addr #0 align 2 {
+define weak_odr hidden ptr @quux(ptr %arg, ptr %arg1) local_unnamed_addr #0 align 2 {
; CHECK-LABEL: @quux(
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[TMP:%.*]] = getelementptr inbounds %struct.barney, %struct.barney* %arg, i64 0, i32 3, i32 0, i32 0, i32 0
-; CHECK-NEXT: [[TMP2:%.*]] = bitcast %struct.spam* [[TMP]] to %struct.foo**
-; CHECK-NEXT: [[TMP3:%.*]] = load %struct.foo*, %struct.foo** [[TMP2]], align 8, !tbaa !2
-; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds %struct.barney, %struct.barney* %arg, i64 0, i32 3, i32 0, i32 0, i32 0, i32 0, i32 1
-; CHECK-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to %struct.foo**
-; CHECK-NEXT: [[TMP6:%.*]] = load %struct.foo*, %struct.foo** [[TMP5]], align 8, !tbaa !7
-; CHECK-NEXT: [[TMP7:%.*]] = icmp eq %struct.foo* [[TMP3]], [[TMP6]]
+; CHECK-NEXT: [[TMP:%.*]] = getelementptr inbounds %struct.barney, ptr %arg, i64 0, i32 3, i32 0, i32 0, i32 0
+; CHECK-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP]], align 8, !tbaa !2
+; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds %struct.barney, ptr %arg, i64 0, i32 3, i32 0, i32 0, i32 0, i32 0, i32 1
+; CHECK-NEXT: [[TMP6:%.*]] = load ptr, ptr [[TMP4]], align 8, !tbaa !7
+; CHECK-NEXT: [[TMP7:%.*]] = icmp eq ptr [[TMP3]], [[TMP6]]
; CHECK-NEXT: br i1 [[TMP7]], label %bb21, label %bb8
; CHECK: bb8:
; CHECK-NEXT: br label %bb11
; CHECK: bb9:
-; CHECK-NEXT: [[TMP10:%.*]] = icmp eq %struct.foo* [[TMP18:%.*]], [[TMP6]]
+; CHECK-NEXT: [[TMP10:%.*]] = icmp eq ptr [[TMP18:%.*]], [[TMP6]]
; CHECK-NEXT: br i1 [[TMP10]], label %bb19, label %bb11
; CHECK: bb11:
-; CHECK-NEXT: [[TMP12:%.*]] = phi %struct.foo* [ [[TMP17:%.*]], %bb9 ], [ undef, %bb8 ]
-; CHECK-NEXT: [[TMP13:%.*]] = phi %struct.foo* [ [[TMP18]], %bb9 ], [ [[TMP3]], %bb8 ]
-; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds %struct.foo, %struct.foo* [[TMP13]], i64 0, i32 0
-; CHECK-NEXT: [[TMP15:%.*]] = load %struct.wombat.28*, %struct.wombat.28** [[TMP14]], align 8, !tbaa !8
-; CHECK-NEXT: [[TMP16:%.*]] = icmp eq %struct.wombat.28* [[TMP15]], %arg1
-; CHECK-NEXT: [[TMP17]] = select i1 [[TMP16]], %struct.foo* [[TMP13]], %struct.foo* [[TMP12]]
-; CHECK-NEXT: [[TMP18]] = getelementptr inbounds %struct.foo, %struct.foo* [[TMP13]], i64 1
+; CHECK-NEXT: [[TMP12:%.*]] = phi ptr [ [[TMP17:%.*]], %bb9 ], [ undef, %bb8 ]
+; CHECK-NEXT: [[TMP13:%.*]] = phi ptr [ [[TMP18]], %bb9 ], [ [[TMP3]], %bb8 ]
+; CHECK-NEXT: [[TMP15:%.*]] = load ptr, ptr [[TMP13]], align 8, !tbaa !8
+; CHECK-NEXT: [[TMP16:%.*]] = icmp eq ptr [[TMP15]], %arg1
+; CHECK-NEXT: [[TMP17]] = select i1 [[TMP16]], ptr [[TMP13]], ptr [[TMP12]]
+; CHECK-NEXT: [[TMP18]] = getelementptr inbounds %struct.foo, ptr [[TMP13]], i64 1
; CHECK-NEXT: br i1 [[TMP16]], label %bb19, label %bb9
; CHECK: bb19:
-; CHECK-NEXT: [[TMP20:%.*]] = phi %struct.foo* [ null, %bb9 ], [ [[TMP17]], %bb11 ]
+; CHECK-NEXT: [[TMP20:%.*]] = phi ptr [ null, %bb9 ], [ [[TMP17]], %bb11 ]
; CHECK-NEXT: br label %bb21
; CHECK: bb21:
-; CHECK-NEXT: [[TMP22:%.*]] = phi %struct.foo* [ null, %bb ], [ [[TMP20]], %bb19 ]
-; CHECK-NEXT: ret %struct.foo* [[TMP22]]
+; CHECK-NEXT: [[TMP22:%.*]] = phi ptr [ null, %bb ], [ [[TMP20]], %bb19 ]
+; CHECK-NEXT: ret ptr [[TMP22]]
;
bb:
- %tmp = getelementptr inbounds %struct.barney, %struct.barney* %arg, i64 0, i32 3, i32 0, i32 0, i32 0
- %tmp2 = bitcast %struct.spam* %tmp to %struct.foo**
- %tmp3 = load %struct.foo*, %struct.foo** %tmp2, align 8, !tbaa !2
- %tmp4 = getelementptr inbounds %struct.barney, %struct.barney* %arg, i64 0, i32 3, i32 0, i32 0, i32 0, i32 0, i32 1
- %tmp5 = bitcast i8** %tmp4 to %struct.foo**
- %tmp6 = load %struct.foo*, %struct.foo** %tmp5, align 8, !tbaa !7
- %tmp7 = icmp eq %struct.foo* %tmp3, %tmp6
+ %tmp = getelementptr inbounds %struct.barney, ptr %arg, i64 0, i32 3, i32 0, i32 0, i32 0
+ %tmp3 = load ptr, ptr %tmp, align 8, !tbaa !2
+ %tmp4 = getelementptr inbounds %struct.barney, ptr %arg, i64 0, i32 3, i32 0, i32 0, i32 0, i32 0, i32 1
+ %tmp6 = load ptr, ptr %tmp4, align 8, !tbaa !7
+ %tmp7 = icmp eq ptr %tmp3, %tmp6
br i1 %tmp7, label %bb21, label %bb8
bb8: ; preds = %bb
br label %bb11
bb9: ; preds = %bb11
- %tmp10 = icmp eq %struct.foo* %tmp18, %tmp6
+ %tmp10 = icmp eq ptr %tmp18, %tmp6
br i1 %tmp10, label %bb19, label %bb11
bb11: ; preds = %bb9, %bb8
- %tmp12 = phi %struct.foo* [ %tmp17, %bb9 ], [ undef, %bb8 ]
- %tmp13 = phi %struct.foo* [ %tmp18, %bb9 ], [ %tmp3, %bb8 ]
- %tmp14 = getelementptr inbounds %struct.foo, %struct.foo* %tmp13, i64 0, i32 0
- %tmp15 = load %struct.wombat.28*, %struct.wombat.28** %tmp14, align 8, !tbaa !8
- %tmp16 = icmp eq %struct.wombat.28* %tmp15, %arg1
- %tmp17 = select i1 %tmp16, %struct.foo* %tmp13, %struct.foo* %tmp12
- %tmp18 = getelementptr inbounds %struct.foo, %struct.foo* %tmp13, i64 1
+ %tmp12 = phi ptr [ %tmp17, %bb9 ], [ undef, %bb8 ]
+ %tmp13 = phi ptr [ %tmp18, %bb9 ], [ %tmp3, %bb8 ]
+ %tmp15 = load ptr, ptr %tmp13, align 8, !tbaa !8
+ %tmp16 = icmp eq ptr %tmp15, %arg1
+ %tmp17 = select i1 %tmp16, ptr %tmp13, ptr %tmp12
+ %tmp18 = getelementptr inbounds %struct.foo, ptr %tmp13, i64 1
br i1 %tmp16, label %bb19, label %bb9
bb19: ; preds = %bb11, %bb9
- %tmp20 = phi %struct.foo* [ null, %bb9 ], [ %tmp17, %bb11 ]
+ %tmp20 = phi ptr [ null, %bb9 ], [ %tmp17, %bb11 ]
br label %bb21
bb21: ; preds = %bb19, %bb
- %tmp22 = phi %struct.foo* [ null, %bb ], [ %tmp20, %bb19 ]
- ret %struct.foo* %tmp22
+ %tmp22 = phi ptr [ null, %bb ], [ %tmp20, %bb19 ]
+ ret ptr %tmp22
}
attributes #0 = { norecurse nounwind ssp uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+fxsr,+mmx,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
diff --git a/llvm/test/Transforms/NewGVN/pr31573.ll b/llvm/test/Transforms/NewGVN/pr31573.ll
index 8da19938c27a..2382c487c19a 100644
--- a/llvm/test/Transforms/NewGVN/pr31573.ll
+++ b/llvm/test/Transforms/NewGVN/pr31573.ll
@@ -3,27 +3,27 @@
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-define void @patatino(i8* %blah) {
+define void @patatino(ptr %blah) {
; CHECK-LABEL: @patatino(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[WHILE_COND:%.*]]
; CHECK: while.cond:
-; CHECK-NEXT: [[MEH:%.*]] = phi i8* [ [[BLAH:%.*]], [[ENTRY:%.*]] ], [ null, [[WHILE_BODY:%.*]] ]
+; CHECK-NEXT: [[MEH:%.*]] = phi ptr [ [[BLAH:%.*]], [[ENTRY:%.*]] ], [ null, [[WHILE_BODY:%.*]] ]
; CHECK-NEXT: switch i32 undef, label [[WHILE_BODY]] [
; CHECK-NEXT: i32 666, label [[WHILE_END:%.*]]
; CHECK-NEXT: ]
; CHECK: while.body:
; CHECK-NEXT: br label [[WHILE_COND]]
; CHECK: while.end:
-; CHECK-NEXT: store i8 0, i8* [[MEH]], align 1
-; CHECK-NEXT: store i8 0, i8* [[BLAH]], align 1
+; CHECK-NEXT: store i8 0, ptr [[MEH]], align 1
+; CHECK-NEXT: store i8 0, ptr [[BLAH]], align 1
; CHECK-NEXT: ret void
;
entry:
br label %while.cond
while.cond:
- %meh = phi i8* [ %blah, %entry ], [ null, %while.body ]
+ %meh = phi ptr [ %blah, %entry ], [ null, %while.body ]
switch i32 undef, label %while.body [
i32 666, label %while.end
]
@@ -36,7 +36,7 @@ while.end:
;; the second store would previously end up deciding it's equivalent to a previous
;; store, but it was really just finding an optimistic version of itself
;; in the congruence class.
- store i8 0, i8* %meh, align 1
- store i8 0, i8* %blah, align 1
+ store i8 0, ptr %meh, align 1
+ store i8 0, ptr %blah, align 1
ret void
}
diff --git a/llvm/test/Transforms/NewGVN/pr31594.ll b/llvm/test/Transforms/NewGVN/pr31594.ll
index c7f7f2b298d1..47294d5640e4 100644
--- a/llvm/test/Transforms/NewGVN/pr31594.ll
+++ b/llvm/test/Transforms/NewGVN/pr31594.ll
@@ -3,12 +3,12 @@
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-define i1 @patatino(i8* %blah, i32 %choice) {
+define i1 @patatino(ptr %blah, i32 %choice) {
; CHECK-LABEL: @patatino(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[WHILE_COND:%.*]]
; CHECK: while.cond:
-; CHECK-NEXT: [[FOO:%.*]] = phi i8* [ [[BLAH:%.*]], [[ENTRY:%.*]] ], [ null, [[WHILE_BODY:%.*]] ]
+; CHECK-NEXT: [[FOO:%.*]] = phi ptr [ [[BLAH:%.*]], [[ENTRY:%.*]] ], [ null, [[WHILE_BODY:%.*]] ]
; CHECK-NEXT: switch i32 [[CHOICE:%.*]], label [[WHILE_BODY]] [
; CHECK-NEXT: i32 -1, label [[WHILE_END:%.*]]
; CHECK-NEXT: i32 40, label [[LAND_END:%.*]]
@@ -18,17 +18,17 @@ define i1 @patatino(i8* %blah, i32 %choice) {
; CHECK: while.body:
; CHECK-NEXT: br label [[WHILE_COND]]
; CHECK: while.end:
-; CHECK-NEXT: store i8 0, i8* [[FOO]], align 1
-; CHECK-NEXT: [[TMP0:%.*]] = load i8, i8* [[BLAH]], align 1
+; CHECK-NEXT: store i8 0, ptr [[FOO]], align 1
+; CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[BLAH]], align 1
; CHECK-NEXT: [[LOADED:%.*]] = icmp eq i8 [[TMP0]], 0
-; CHECK-NEXT: store i8 0, i8* [[BLAH]], align 1
+; CHECK-NEXT: store i8 0, ptr [[BLAH]], align 1
; CHECK-NEXT: ret i1 [[LOADED]]
;
entry:
br label %while.cond
while.cond:
- %foo = phi i8* [ %blah, %entry ], [ null, %while.body ]
+ %foo = phi ptr [ %blah, %entry ], [ null, %while.body ]
switch i32 %choice, label %while.body [
i32 -1, label %while.end
i32 40, label %land.end
@@ -41,32 +41,32 @@ while.body:
br label %while.cond
while.end:
- %foo.lcssa = phi i8* [ %foo, %land.end ], [ %foo, %while.cond ]
+ %foo.lcssa = phi ptr [ %foo, %land.end ], [ %foo, %while.cond ]
;; These two stores will initially be considered equivalent, but then proven not.
;; the second store would previously end up deciding it's equivalent to a previous
;; store, but it was really just finding an optimistic version of itself
;; in the congruence class.
- store i8 0, i8* %foo.lcssa, align 1
- %0 = load i8, i8* %blah, align 1
+ store i8 0, ptr %foo.lcssa, align 1
+ %0 = load i8, ptr %blah, align 1
%loaded = icmp eq i8 %0, 0
- store i8 0, i8* %blah, align 1
+ store i8 0, ptr %blah, align 1
ret i1 %loaded
}
;; This is an example of a case where the memory states are equivalent solely due to unreachability,
;; but the stores are not equal.
-define void @foo(i8* %arg) {
+define void @foo(ptr %arg) {
; CHECK-LABEL: @foo(
; CHECK-NEXT: bb:
; CHECK-NEXT: br label [[BB1:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[TMP:%.*]] = phi i8* [ [[ARG:%.*]], [[BB:%.*]] ], [ null, [[BB2:%.*]] ]
+; CHECK-NEXT: [[TMP:%.*]] = phi ptr [ [[ARG:%.*]], [[BB:%.*]] ], [ null, [[BB2:%.*]] ]
; CHECK-NEXT: br i1 undef, label [[BB3:%.*]], label [[BB2]]
; CHECK: bb2:
; CHECK-NEXT: br label [[BB1]]
; CHECK: bb3:
-; CHECK-NEXT: store i8 0, i8* [[TMP]], align 1, !g !0
+; CHECK-NEXT: store i8 0, ptr [[TMP]], align 1, !g !0
; CHECK-NEXT: br label [[BB4:%.*]]
; CHECK: bb4:
; CHECK-NEXT: br label [[BB6:%.*]]
@@ -77,28 +77,28 @@ define void @foo(i8* %arg) {
; CHECK-NEXT: i8 6, label [[BB8:%.*]]
; CHECK-NEXT: ]
; CHECK: bb8:
-; CHECK-NEXT: store i8 poison, i8* null, align 1
+; CHECK-NEXT: store i8 poison, ptr null, align 1
; CHECK-NEXT: br label [[BB4]]
; CHECK: bb9:
-; CHECK-NEXT: store i8 0, i8* [[ARG]], align 1, !g !0
+; CHECK-NEXT: store i8 0, ptr [[ARG]], align 1, !g !0
; CHECK-NEXT: unreachable
;
bb:
br label %bb1
bb1: ; preds = %bb2, %bb
- %tmp = phi i8* [ %arg, %bb ], [ null, %bb2 ]
+ %tmp = phi ptr [ %arg, %bb ], [ null, %bb2 ]
br i1 undef, label %bb3, label %bb2
bb2: ; preds = %bb1
br label %bb1
bb3: ; preds = %bb1
- store i8 0, i8* %tmp, !g !0
+ store i8 0, ptr %tmp, !g !0
br label %bb4
bb4: ; preds = %bb8, %bb3
- %tmp5 = phi i8* [ null, %bb8 ], [ %arg, %bb3 ]
+ %tmp5 = phi ptr [ null, %bb8 ], [ %arg, %bb3 ]
br label %bb6
bb6: ; preds = %bb7, %bb4
@@ -110,12 +110,12 @@ bb7: ; preds = %bb6
]
bb8: ; preds = %bb7
- store i8 undef, i8* %tmp5, !g !0
+ store i8 undef, ptr %tmp5, !g !0
br label %bb4
bb9: ; preds = %bb6
- %tmp10 = phi i8* [ %tmp5, %bb6 ]
- store i8 0, i8* %tmp10, !g !0
+ %tmp10 = phi ptr [ %tmp5, %bb6 ]
+ store i8 0, ptr %tmp10, !g !0
unreachable
}
diff --git a/llvm/test/Transforms/NewGVN/pr31613_2.ll b/llvm/test/Transforms/NewGVN/pr31613_2.ll
index d55172c09c09..4251fe8e354f 100644
--- a/llvm/test/Transforms/NewGVN/pr31613_2.ll
+++ b/llvm/test/Transforms/NewGVN/pr31613_2.ll
@@ -10,7 +10,7 @@ define hidden void @barrier() align 2 {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALLG:%.*]] = tail call i64 @g()
; CHECK-NEXT: [[SEL:%.*]] = select i1 undef, i64 0, i64 [[CALLG]]
-; CHECK-NEXT: [[LOADED:%.*]] = load i64, i64* null, align 8
+; CHECK-NEXT: [[LOADED:%.*]] = load i64, ptr null, align 8
; CHECK-NEXT: [[ADD:%.*]] = add i64 [[LOADED]], 1
; CHECK-NEXT: [[SHR17:%.*]] = lshr i64 [[ADD]], 1
; CHECK-NEXT: [[SUB:%.*]] = add nsw i64 [[SHR17]], -1
@@ -28,7 +28,7 @@ entry:
%callg = tail call i64 @g()
%sel = select i1 undef, i64 0, i64 %callg
- %loaded = load i64, i64* null, align 8
+ %loaded = load i64, ptr null, align 8
%add = add i64 %loaded, 1
%shr17 = lshr i64 %add, 1
%sub = add nsw i64 %shr17, -1
@@ -53,7 +53,7 @@ third:
define hidden void @barrier2() align 2 {
; CHECK-LABEL: @barrier2(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i64, i64* null, align 8
+; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr null, align 8
; CHECK-NEXT: [[CALL9:%.*]] = tail call i64 @g()
; CHECK-NEXT: [[REM:%.*]] = select i1 undef, i64 0, i64 [[CALL9]]
; CHECK-NEXT: [[ADD:%.*]] = add i64 [[TMP0]], 1
@@ -76,7 +76,7 @@ define hidden void @barrier2() align 2 {
; CHECK-NEXT: br i1 false, label [[INNERLOOP]], label [[SECOND_EXIT:%.*]]
;
entry:
- %0 = load i64, i64* null, align 8
+ %0 = load i64, ptr null, align 8
%call9 = tail call i64 @g()
%rem = select i1 undef, i64 0, i64 %call9
%add = add i64 %0, 1
diff --git a/llvm/test/Transforms/NewGVN/pr31682.ll b/llvm/test/Transforms/NewGVN/pr31682.ll
index 03ee9f3f7d9f..00a1bf2b8450 100644
--- a/llvm/test/Transforms/NewGVN/pr31682.ll
+++ b/llvm/test/Transforms/NewGVN/pr31682.ll
@@ -4,12 +4,12 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
%struct.foo = type { i32, i32, [2 x [4 x [6 x [6 x i16]]]] }
- at global = external global %struct.foo*
+ at global = external global ptr
define void @bar() {
; CHECK-LABEL: @bar(
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[TMP:%.*]] = load %struct.foo*, %struct.foo** @global
+; CHECK-NEXT: [[TMP:%.*]] = load ptr, ptr @global
; CHECK-NEXT: br label [[BB2:%.*]]
; CHECK: bb2:
; CHECK-NEXT: br i1 undef, label [[BB2]], label [[BB7:%.*]]
@@ -19,23 +19,23 @@ define void @bar() {
; CHECK-NEXT: br label [[BB10]]
;
bb:
- %tmp = load %struct.foo*, %struct.foo** @global
- %tmp1 = getelementptr %struct.foo, %struct.foo* %tmp
+ %tmp = load ptr, ptr @global
+ %tmp1 = getelementptr %struct.foo, ptr %tmp
br label %bb2
bb2: ; preds = %bb2, %bb
- %tmp3 = phi %struct.foo* [ poison, %bb ], [ %tmp6, %bb2 ]
- %tmp4 = getelementptr %struct.foo, %struct.foo* %tmp3, i64 0, i32 1
- %tmp5 = load i32, i32* %tmp4
- %tmp6 = load %struct.foo*, %struct.foo** @global
+ %tmp3 = phi ptr [ poison, %bb ], [ %tmp6, %bb2 ]
+ %tmp4 = getelementptr %struct.foo, ptr %tmp3, i64 0, i32 1
+ %tmp5 = load i32, ptr %tmp4
+ %tmp6 = load ptr, ptr @global
br i1 undef, label %bb2, label %bb7
bb7: ; preds = %bb2
- %tmp8 = phi %struct.foo* [ %tmp6, %bb2 ]
- %tmp9 = getelementptr %struct.foo, %struct.foo* %tmp8, i64 0, i32 1
+ %tmp8 = phi ptr [ %tmp6, %bb2 ]
+ %tmp9 = getelementptr %struct.foo, ptr %tmp8, i64 0, i32 1
br label %bb10
bb10: ; preds = %bb10, %bb7
- %tmp11 = load i32, i32* %tmp9
+ %tmp11 = load i32, ptr %tmp9
br label %bb10
}
diff --git a/llvm/test/Transforms/NewGVN/pr31758.ll b/llvm/test/Transforms/NewGVN/pr31758.ll
index b94b81e155ea..43188430e34c 100644
--- a/llvm/test/Transforms/NewGVN/pr31758.ll
+++ b/llvm/test/Transforms/NewGVN/pr31758.ll
@@ -2,7 +2,7 @@
; RUN: opt -passes=newgvn %s -S -o - | FileCheck %s
%struct.dipsy = type {}
-%struct.fluttershy = type { %struct.dipsy* }
+%struct.fluttershy = type { ptr }
%struct.patatino = type {}
define void @tinkywinky() {
@@ -12,23 +12,19 @@ define void @tinkywinky() {
; CHECK: bb90:
; CHECK-NEXT: br label [[BB90]]
; CHECK: bb138:
-; CHECK-NEXT: store i8 poison, i8* null
+; CHECK-NEXT: store i8 poison, ptr null
; CHECK-NEXT: br label [[BB138:%.*]]
;
bb:
br label %bb90
bb90:
- %tmp = getelementptr inbounds %struct.fluttershy, %struct.fluttershy* undef, i64 0, i32 0
- %tmp91 = bitcast %struct.dipsy** %tmp to %struct.patatino**
- %tmp92 = load %struct.patatino*, %struct.patatino** %tmp91, align 8
- %tmp99 = getelementptr inbounds %struct.patatino, %struct.patatino* %tmp92
- %tmp134 = getelementptr inbounds %struct.fluttershy, %struct.fluttershy* undef, i64 0, i32 0
- %tmp135 = bitcast %struct.dipsy** %tmp134 to %struct.patatino**
- %tmp136 = load %struct.patatino*, %struct.patatino** %tmp135, align 8
+ %tmp92 = load ptr, ptr undef, align 8
+ %tmp99 = getelementptr inbounds %struct.patatino, ptr %tmp92
+ %tmp136 = load ptr, ptr undef, align 8
br label %bb90
bb138:
- %tmp139 = getelementptr inbounds %struct.patatino, %struct.patatino* %tmp136
+ %tmp139 = getelementptr inbounds %struct.patatino, ptr %tmp136
br label %bb138
}
diff --git a/llvm/test/Transforms/NewGVN/pr32607.ll b/llvm/test/Transforms/NewGVN/pr32607.ll
index c62930f15bda..4770724dc2ba 100644
--- a/llvm/test/Transforms/NewGVN/pr32607.ll
+++ b/llvm/test/Transforms/NewGVN/pr32607.ll
@@ -7,11 +7,11 @@ define hidden void @foo() {
; CHECK: if:
; CHECK-NEXT: br i1 false, label [[L50:%.*]], label [[IF]]
; CHECK: L50:
-; CHECK-NEXT: store i8 poison, i8* null
+; CHECK-NEXT: store i8 poison, ptr null
; CHECK-NEXT: ret void
;
top:
- %.promoted = load double, double* undef, align 8
+ %.promoted = load double, ptr undef, align 8
br label %if
;; This is really a multi-valued phi, because the phi is defined by an expression of the phi.
@@ -25,7 +25,7 @@ if: ; preds = %if, %top
L50: ; preds = %if
%.lcssa = phi double [ %1, %if ]
- store double %.lcssa, double* undef, align 8
+ store double %.lcssa, ptr undef, align 8
ret void
}
diff --git a/llvm/test/Transforms/NewGVN/pr32836.ll b/llvm/test/Transforms/NewGVN/pr32836.ll
index 17a459dc0fbd..5488655b3683 100644
--- a/llvm/test/Transforms/NewGVN/pr32836.ll
+++ b/llvm/test/Transforms/NewGVN/pr32836.ll
@@ -5,40 +5,40 @@
@b = external global %struct.anon
define void @tinkywinky(i1 %patatino) {
; CHECK-LABEL: @tinkywinky(
-; CHECK-NEXT: store i32 8, i32* null
+; CHECK-NEXT: store i32 8, ptr null
; CHECK-NEXT: br i1 [[PATATINO:%.*]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; CHECK: if.then:
; CHECK-NEXT: br label [[L:%.*]]
; CHECK: L:
; CHECK-NEXT: br label [[IF_END]]
; CHECK: if.end:
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* null
-; CHECK-NEXT: [[BF_LOAD1:%.*]] = load i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @b, i64 0, i32 0)
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr null
+; CHECK-NEXT: [[BF_LOAD1:%.*]] = load i32, ptr @b
; CHECK-NEXT: [[BF_VALUE:%.*]] = and i32 [[TMP1]], 536870911
; CHECK-NEXT: [[BF_CLEAR:%.*]] = and i32 [[BF_LOAD1]], -536870912
; CHECK-NEXT: [[BF_SET:%.*]] = or i32 [[BF_CLEAR]], [[BF_VALUE]]
-; CHECK-NEXT: store i32 [[BF_SET]], i32* getelementptr inbounds (%struct.anon, %struct.anon* @b, i64 0, i32 0)
+; CHECK-NEXT: store i32 [[BF_SET]], ptr @b
; CHECK-NEXT: br label [[LOR_END:%.*]]
; CHECK: lor.end:
; CHECK-NEXT: br label [[L]]
;
- store i32 8, i32* null
+ store i32 8, ptr null
br i1 %patatino, label %if.end, label %if.then
if.then:
- store i32 8, i32* null
+ store i32 8, ptr null
br label %L
L:
br label %if.end
if.end:
- %tmp1 = load i32, i32* null
- %bf.load1 = load i32, i32* getelementptr (%struct.anon, %struct.anon* @b, i64 0, i32 0)
+ %tmp1 = load i32, ptr null
+ %bf.load1 = load i32, ptr @b
%bf.value = and i32 %tmp1, 536870911
%bf.clear = and i32 %bf.load1, -536870912
%bf.set = or i32 %bf.clear, %bf.value
- store i32 %bf.set, i32* getelementptr (%struct.anon, %struct.anon* @b, i64 0, i32 0)
+ store i32 %bf.set, ptr @b
br label %lor.end
lor.end:
- %bf.load4 = load i32, i32* getelementptr (%struct.anon, %struct.anon* @b, i64 0, i32 0)
+ %bf.load4 = load i32, ptr @b
%tmp4 = and i32 %bf.load4, 536870911
%or = or i32 0, %tmp4
br label %L
diff --git a/llvm/test/Transforms/NewGVN/pr32838.ll b/llvm/test/Transforms/NewGVN/pr32838.ll
index 594f8d2ba448..5ba68fa15c24 100644
--- a/llvm/test/Transforms/NewGVN/pr32838.ll
+++ b/llvm/test/Transforms/NewGVN/pr32838.ll
@@ -102,10 +102,10 @@ define void @fn3() {
; CHECK: l1.loopexit:
; CHECK-NEXT: br label [[L1]]
; CHECK: l1:
-; CHECK-NEXT: [[F_0:%.*]] = phi i32* [ @b, [[ENTRY:%.*]] ], [ @a, [[L1_LOOPEXIT:%.*]] ]
+; CHECK-NEXT: [[F_0:%.*]] = phi ptr [ @b, [[ENTRY:%.*]] ], [ @a, [[L1_LOOPEXIT:%.*]] ]
; CHECK-NEXT: br label [[FOR_COND:%.*]]
; CHECK: for.cond.loopexit:
-; CHECK-NEXT: store i8 poison, i8* null
+; CHECK-NEXT: store i8 poison, ptr null
; CHECK-NEXT: br label [[FOR_COND]]
; CHECK: for.cond:
; CHECK-NEXT: br i1 undef, label [[FOR_END14:%.*]], label [[FOR_COND1_PREHEADER:%.*]]
@@ -116,8 +116,8 @@ define void @fn3() {
; CHECK: for.body3:
; CHECK-NEXT: br i1 undef, label [[FOR_COND1:%.*]], label [[L1_LOOPEXIT]]
; CHECK: l2:
-; CHECK-NEXT: [[G_4:%.*]] = phi i32* [ @b, [[FOR_END14]] ], [ @a, [[FOR_COND1]] ]
-; CHECK-NEXT: [[F_2:%.*]] = phi i32* [ [[F_0]], [[FOR_END14]] ], [ @a, [[FOR_COND1]] ]
+; CHECK-NEXT: [[G_4:%.*]] = phi ptr [ @b, [[FOR_END14]] ], [ @a, [[FOR_COND1]] ]
+; CHECK-NEXT: [[F_2:%.*]] = phi ptr [ [[F_0]], [[FOR_END14]] ], [ @a, [[FOR_COND1]] ]
; CHECK-NEXT: br label [[FOR_INC:%.*]]
; CHECK: for.inc:
; CHECK-NEXT: br i1 false, label [[FOR_COND_LOOPEXIT:%.*]], label [[FOR_INC]]
@@ -127,17 +127,17 @@ define void @fn3() {
entry:
br label %l1
l1.loopexit:
- %g.223.lcssa = phi i32* [ @b, %for.body3 ]
+ %g.223.lcssa = phi ptr [ @b, %for.body3 ]
br label %l1
l1:
- %g.0 = phi i32* [ undef, %entry ], [ %g.223.lcssa, %l1.loopexit ]
- %f.0 = phi i32* [ @b, %entry ], [ @a, %l1.loopexit ]
+ %g.0 = phi ptr [ undef, %entry ], [ %g.223.lcssa, %l1.loopexit ]
+ %f.0 = phi ptr [ @b, %entry ], [ @a, %l1.loopexit ]
br label %for.cond
for.cond.loopexit:
br label %for.cond
for.cond:
- %g.1 = phi i32* [ %g.0, %l1 ], [ %g.4, %for.cond.loopexit ]
- %f.1 = phi i32* [ %f.0, %l1 ], [ %f.2, %for.cond.loopexit ]
+ %g.1 = phi ptr [ %g.0, %l1 ], [ %g.4, %for.cond.loopexit ]
+ %f.1 = phi ptr [ %f.0, %l1 ], [ %f.2, %for.cond.loopexit ]
br i1 undef, label %for.end14, label %for.cond1.preheader
for.cond1.preheader:
br label %for.body3
@@ -146,8 +146,8 @@ for.cond1:
for.body3:
br i1 undef, label %for.cond1, label %l1.loopexit
l2:
- %g.4 = phi i32* [ %g.1, %for.end14 ], [ @a, %for.cond1 ]
- %f.2 = phi i32* [ %f.1, %for.end14 ], [ @a, %for.cond1 ]
+ %g.4 = phi ptr [ %g.1, %for.end14 ], [ @a, %for.cond1 ]
+ %f.2 = phi ptr [ %f.1, %for.end14 ], [ @a, %for.cond1 ]
br label %for.inc
for.inc:
br i1 false, label %for.cond.loopexit, label %for.inc
diff --git a/llvm/test/Transforms/NewGVN/pr32845.ll b/llvm/test/Transforms/NewGVN/pr32845.ll
index 7ade95f16877..d1182a627c59 100644
--- a/llvm/test/Transforms/NewGVN/pr32845.ll
+++ b/llvm/test/Transforms/NewGVN/pr32845.ll
@@ -10,10 +10,10 @@ define void @tinkywinky() {
; CHECK: l1.loopexit:
; CHECK-NEXT: br label [[L1]]
; CHECK: l1:
-; CHECK-NEXT: [[F_0:%.*]] = phi i32* [ @b, [[ENTRY:%.*]] ], [ @a, [[L1_LOOPEXIT:%.*]] ]
+; CHECK-NEXT: [[F_0:%.*]] = phi ptr [ @b, [[ENTRY:%.*]] ], [ @a, [[L1_LOOPEXIT:%.*]] ]
; CHECK-NEXT: br label [[FOR_COND:%.*]]
; CHECK: for.cond.loopexit:
-; CHECK-NEXT: store i8 poison, i8* null
+; CHECK-NEXT: store i8 poison, ptr null
; CHECK-NEXT: br label [[FOR_COND]]
; CHECK: for.cond:
; CHECK-NEXT: br i1 undef, label [[FOR_END14:%.*]], label [[FOR_COND1_PREHEADER:%.*]]
@@ -24,8 +24,8 @@ define void @tinkywinky() {
; CHECK: for.body3:
; CHECK-NEXT: br i1 undef, label [[FOR_COND1:%.*]], label [[L1_LOOPEXIT]]
; CHECK: l2:
-; CHECK-NEXT: [[G_4:%.*]] = phi i32* [ @b, [[FOR_END14]] ], [ @a, [[FOR_COND1]] ]
-; CHECK-NEXT: [[F_2:%.*]] = phi i32* [ [[F_0]], [[FOR_END14]] ], [ @a, [[FOR_COND1]] ]
+; CHECK-NEXT: [[G_4:%.*]] = phi ptr [ @b, [[FOR_END14]] ], [ @a, [[FOR_COND1]] ]
+; CHECK-NEXT: [[F_2:%.*]] = phi ptr [ [[F_0]], [[FOR_END14]] ], [ @a, [[FOR_COND1]] ]
; CHECK-NEXT: br label [[FOR_INC:%.*]]
; CHECK: for.inc:
; CHECK-NEXT: br i1 false, label [[FOR_COND_LOOPEXIT:%.*]], label [[FOR_INC]]
@@ -35,17 +35,17 @@ define void @tinkywinky() {
entry:
br label %l1
l1.loopexit:
- %g.223.lcssa = phi i32* [ @b, %for.body3 ]
+ %g.223.lcssa = phi ptr [ @b, %for.body3 ]
br label %l1
l1:
- %g.0 = phi i32* [ undef, %entry ], [ %g.223.lcssa, %l1.loopexit ]
- %f.0 = phi i32* [ @b, %entry ], [ @a, %l1.loopexit ]
+ %g.0 = phi ptr [ undef, %entry ], [ %g.223.lcssa, %l1.loopexit ]
+ %f.0 = phi ptr [ @b, %entry ], [ @a, %l1.loopexit ]
br label %for.cond
for.cond.loopexit:
br label %for.cond
for.cond:
- %g.1 = phi i32* [ %g.0, %l1 ], [ %g.4, %for.cond.loopexit ]
- %f.1 = phi i32* [ %f.0, %l1 ], [ %f.2, %for.cond.loopexit ]
+ %g.1 = phi ptr [ %g.0, %l1 ], [ %g.4, %for.cond.loopexit ]
+ %f.1 = phi ptr [ %f.0, %l1 ], [ %f.2, %for.cond.loopexit ]
br i1 undef, label %for.end14, label %for.cond1.preheader
for.cond1.preheader:
br label %for.body3
@@ -54,8 +54,8 @@ for.cond1:
for.body3:
br i1 undef, label %for.cond1, label %l1.loopexit
l2:
- %g.4 = phi i32* [ %g.1, %for.end14 ], [ @a, %for.cond1 ]
- %f.2 = phi i32* [ %f.1, %for.end14 ], [ @a, %for.cond1 ]
+ %g.4 = phi ptr [ %g.1, %for.end14 ], [ @a, %for.cond1 ]
+ %f.2 = phi ptr [ %f.1, %for.end14 ], [ @a, %for.cond1 ]
br label %for.inc
for.inc:
br i1 false, label %for.cond.loopexit, label %for.inc
diff --git a/llvm/test/Transforms/NewGVN/pr32852.ll b/llvm/test/Transforms/NewGVN/pr32852.ll
index 79abbe09a931..4fd5cf1a95fa 100644
--- a/llvm/test/Transforms/NewGVN/pr32852.ll
+++ b/llvm/test/Transforms/NewGVN/pr32852.ll
@@ -7,7 +7,7 @@
define void @tinkywinky() {
bb:
- %tmp = load i32, i32* @a
+ %tmp = load i32, ptr @a
%tmp1 = icmp sge i32 %tmp, 0
br i1 %tmp1, label %bb2, label %bb7
bb2:
@@ -15,10 +15,10 @@ bb2:
; CHECK: br i1 %tmp4, label %bb5, label %bb7
br i1 %tmp4, label %bb5, label %bb7
bb5:
- %tmp6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @patatino, i32 0, i32 0))
+ %tmp6 = call i32 (ptr, ...) @printf(ptr @patatino)
br label %bb7
bb7:
ret void
}
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
diff --git a/llvm/test/Transforms/NewGVN/pr32897.ll b/llvm/test/Transforms/NewGVN/pr32897.ll
index 67cfaea9e44e..35a3b0040bca 100644
--- a/llvm/test/Transforms/NewGVN/pr32897.ll
+++ b/llvm/test/Transforms/NewGVN/pr32897.ll
@@ -1,12 +1,12 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=newgvn %s | FileCheck %s
-define void @tinkywinky(i64* %b) {
+define void @tinkywinky(ptr %b) {
; CHECK-LABEL: @tinkywinky(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[BODY:%.*]]
; CHECK: body:
-; CHECK-NEXT: store i64 undef, i64* [[B:%.*]]
+; CHECK-NEXT: store i64 undef, ptr [[B:%.*]]
; CHECK-NEXT: br i1 undef, label [[BODY]], label [[END:%.*]]
; CHECK: end:
; CHECK-NEXT: br label [[BODY]]
@@ -14,11 +14,11 @@ define void @tinkywinky(i64* %b) {
entry:
br label %body
body:
- %d.1 = phi i64* [ undef, %entry ], [ %d.1, %body ], [ %b, %end ]
- store i64 undef, i64* %d.1
- %b2 = load i64, i64* %b
+ %d.1 = phi ptr [ undef, %entry ], [ %d.1, %body ], [ %b, %end ]
+ store i64 undef, ptr %d.1
+ %b2 = load i64, ptr %b
%or = or i64 %b2, 0
- store i64 %or, i64* %b
+ store i64 %or, ptr %b
br i1 undef, label %body, label %end
end:
br label %body
diff --git a/llvm/test/Transforms/NewGVN/pr32934.ll b/llvm/test/Transforms/NewGVN/pr32934.ll
index 3bebcb4f6d16..fa725f8888e7 100644
--- a/llvm/test/Transforms/NewGVN/pr32934.ll
+++ b/llvm/test/Transforms/NewGVN/pr32934.ll
@@ -3,32 +3,32 @@
; CHECK: define void @tinkywinky() {
; CHECK-NEXT: entry:
; CHECK-NEXT: %d = alloca i32, align 4
-; CHECK-NEXT: store i32 0, i32* null, align 4
+; CHECK-NEXT: store i32 0, ptr null, align 4
; CHECK-NEXT: br label %for.cond
; CHECK: for.cond: ; preds = %if.end, %entry
-; CHECK-NEXT: %0 = load i32, i32* null, align 4
+; CHECK-NEXT: %0 = load i32, ptr null, align 4
; CHECK-NEXT: %cmp = icmp slt i32 %0, 1
; CHECK-NEXT: br i1 %cmp, label %for.body, label %while.cond
; CHECK: for.body: ; preds = %for.cond
-; CHECK-NEXT: %1 = load i32, i32* @a, align 4
-; CHECK-NEXT: store i32 %1, i32* %d, align 4
+; CHECK-NEXT: %1 = load i32, ptr @a, align 4
+; CHECK-NEXT: store i32 %1, ptr %d, align 4
; CHECK-NEXT: br label %L
; CHECK: L: ; preds = %if.then, %for.body
; CHECK-NEXT: %tobool = icmp ne i32 %1, 0
; CHECK-NEXT: br i1 %tobool, label %if.then, label %if.end
; CHECK: if.then: ; preds = %L
-; CHECK-NEXT: call void (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @patatino, i32 0, i32 0))
+; CHECK-NEXT: call void (ptr, ...) @printf(ptr @patatino)
; CHECK-NEXT: br label %L
; CHECK: if.end: ; preds = %L
; CHECK-NEXT: br label %for.cond
; CHECK: while.cond: ; preds = %while.body, %for.cond
; CHECK-NEXT: br i1 undef, label %while.body, label %while.end
; CHECK: while.body: ; preds = %while.cond
-; CHECK-NEXT: call void (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @patatino, i32 0, i32 0))
+; CHECK-NEXT: call void (ptr, ...) @printf(ptr @patatino)
; CHECK-NEXT: br label %while.cond
; CHECK: while.end:
-; CHECK-NEXT: %2 = load i32, i32* @a, align 4
-; CHECK-NEXT: store i32 %2, i32* undef, align 4
+; CHECK-NEXT: %2 = load i32, ptr @a, align 4
+; CHECK-NEXT: store i32 %2, ptr undef, align 4
; CHECK-NEXT: ret void
@a = external global i32, align 4
@@ -36,33 +36,33 @@
define void @tinkywinky() {
entry:
%d = alloca i32, align 4
- store i32 0, i32* null, align 4
+ store i32 0, ptr null, align 4
br label %for.cond
for.cond:
- %0 = load i32, i32* null, align 4
+ %0 = load i32, ptr null, align 4
%cmp = icmp slt i32 %0, 1
br i1 %cmp, label %for.body, label %while.cond
for.body:
- %1 = load i32, i32* @a, align 4
- store i32 %1, i32* %d, align 4
+ %1 = load i32, ptr @a, align 4
+ store i32 %1, ptr %d, align 4
br label %L
L:
- %2 = load i32, i32* %d, align 4
+ %2 = load i32, ptr %d, align 4
%tobool = icmp ne i32 %2, 0
br i1 %tobool, label %if.then, label %if.end
if.then:
- call void (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @patatino, i32 0, i32 0))
+ call void (ptr, ...) @printf(ptr @patatino)
br label %L
if.end:
br label %for.cond
while.cond:
br i1 undef, label %while.body, label %while.end
while.body:
- call void (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @patatino, i32 0, i32 0))
+ call void (ptr, ...) @printf(ptr @patatino)
br label %while.cond
while.end:
- %3 = load i32, i32* @a, align 4
- store i32 %3, i32* undef, align 4
+ %3 = load i32, ptr @a, align 4
+ store i32 %3, ptr undef, align 4
ret void
}
-declare void @printf(i8*, ...) #1
+declare void @printf(ptr, ...) #1
diff --git a/llvm/test/Transforms/NewGVN/pr32945.ll b/llvm/test/Transforms/NewGVN/pr32945.ll
index ca7ced77bf29..ebf3813c65bd 100644
--- a/llvm/test/Transforms/NewGVN/pr32945.ll
+++ b/llvm/test/Transforms/NewGVN/pr32945.ll
@@ -6,14 +6,14 @@
define void @tinkywinky() {
br i1 true, label %lor.lhs.false, label %cond.true
lor.lhs.false:
- %tmp = load i32, i32* @d, align 4
- %patatino = load i32, i32* null, align 4
+ %tmp = load i32, ptr @d, align 4
+ %patatino = load i32, ptr null, align 4
%or = or i32 %tmp, %patatino
- store i32 %or, i32* @d, align 4
+ store i32 %or, ptr @d, align 4
br label %cond.true
cond.true:
- %tmp1 = load i32, i32* @e, align 4
- %tmp2 = load i32, i32* @d, align 4
+ %tmp1 = load i32, ptr @e, align 4
+ %tmp2 = load i32, ptr @d, align 4
%cmp = icmp eq i32 %tmp1, %tmp2
br i1 %cmp, label %cond.true6, label %cond.false
cond.true6:
diff --git a/llvm/test/Transforms/NewGVN/pr32952.ll b/llvm/test/Transforms/NewGVN/pr32952.ll
index 2dacd5e359fd..5157bb27e6c5 100644
--- a/llvm/test/Transforms/NewGVN/pr32952.ll
+++ b/llvm/test/Transforms/NewGVN/pr32952.ll
@@ -7,7 +7,7 @@
define i32 @tinkywinky() {
entry:
- %0 = load i16, i16* @a, align 2
+ %0 = load i16, ptr @a, align 2
%conv = sext i16 %0 to i32
%neg = xor i32 %conv, -1
%conv1 = trunc i32 %neg to i16
@@ -16,7 +16,7 @@ entry:
br i1 %cmp, label %tinky, label %winky
tinky:
- store i16 2, i16* @a, align 2
+ store i16 2, ptr @a, align 2
br label %patatino
winky:
@@ -34,9 +34,9 @@ end:
; CHECK: %other = zext i16 %meh to i32
%promoted = zext i16 %banana to i32
%other = zext i16 %meh to i32
- %first = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %promoted)
- %second = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %other)
+ %first = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %promoted)
+ %second = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %other)
ret i32 0
}
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
diff --git a/llvm/test/Transforms/NewGVN/pr33014.ll b/llvm/test/Transforms/NewGVN/pr33014.ll
index 566e701005b7..f6e919770d6c 100644
--- a/llvm/test/Transforms/NewGVN/pr33014.ll
+++ b/llvm/test/Transforms/NewGVN/pr33014.ll
@@ -13,13 +13,13 @@
; CHECK: for.body: ; preds = %ph, %if.then
; CHECK-NEXT: br i1 undef, label %ontrue, label %onfalse
; CHECK: onfalse: ; preds = %for.body
-; CHECK-NEXT: %patatino = load i64, i64* @c
+; CHECK-NEXT: %patatino = load i64, ptr @c
; CHECK-NEXT: ret void
; CHECK: ontrue: ; preds = %for.body
-; CHECK-NEXT: %dipsy = load i64, i64* @c
+; CHECK-NEXT: %dipsy = load i64, ptr @c
; CHECK-NEXT: br label %ph
; CHECK: back: ; preds = %l2
-; CHECK-NEXT: store i8 poison, i8* null
+; CHECK-NEXT: store i8 poison, ptr null
; CHECK-NEXT: br label %ph
; CHECK: end: ; preds = %l2
; CHECK-NEXT: ret void
@@ -37,12 +37,12 @@ ph:
for.body:
br i1 undef, label %ontrue, label %onfalse
onfalse:
- %patatino = load i64, i64* @c
- store i64 %patatino, i64* @c
+ %patatino = load i64, ptr @c
+ store i64 %patatino, ptr @c
ret void
ontrue:
- %dipsy = load i64, i64* @c
- store i64 %dipsy, i64* @c
+ %dipsy = load i64, ptr @c
+ store i64 %dipsy, ptr @c
br label %ph
back:
br label %ph
diff --git a/llvm/test/Transforms/NewGVN/pr33086.ll b/llvm/test/Transforms/NewGVN/pr33086.ll
index 334f5036eed4..54802cdbd925 100644
--- a/llvm/test/Transforms/NewGVN/pr33086.ll
+++ b/llvm/test/Transforms/NewGVN/pr33086.ll
@@ -18,8 +18,8 @@
; CHECK: l1.loopexit:
; CHECK-NEXT: br label %l1
; CHECK: l1:
-; CHECK-NEXT: %0 = load i16, i16* null, align 2
-; CHECK-NEXT: %g.0.g.0..pr = load i16, i16* null, align 2
+; CHECK-NEXT: %0 = load i16, ptr null, align 2
+; CHECK-NEXT: %g.0.g.0..pr = load i16, ptr null, align 2
; CHECK-NEXT: ret void
; CHECK: for.cond18:
; CHECK-NEXT: br label %l1
@@ -47,10 +47,10 @@ l1.loopexit:
br label %l1
l1:
- %h.0 = phi i16* [ undef, %for.cond18 ], [ null, %l1.loopexit ]
- %0 = load i16, i16* %h.0, align 2
- store i16 %0, i16* null, align 2
- %g.0.g.0..pr = load i16, i16* null, align 2
+ %h.0 = phi ptr [ undef, %for.cond18 ], [ null, %l1.loopexit ]
+ %0 = load i16, ptr %h.0, align 2
+ store i16 %0, ptr null, align 2
+ %g.0.g.0..pr = load i16, ptr null, align 2
%tobool15 = icmp eq i16 %g.0.g.0..pr, 0
ret void
diff --git a/llvm/test/Transforms/NewGVN/pr33116.ll b/llvm/test/Transforms/NewGVN/pr33116.ll
index e9ec7b90963e..f5ef3ae7575e 100644
--- a/llvm/test/Transforms/NewGVN/pr33116.ll
+++ b/llvm/test/Transforms/NewGVN/pr33116.ll
@@ -13,7 +13,7 @@ define void @b() {
; CHECK: c:
; CHECK-NEXT: br i1 undef, label [[IF_G:%.*]], label [[IF_E]]
; CHECK: if.g:
-; CHECK-NEXT: store i32 undef, i32* @a
+; CHECK-NEXT: store i32 undef, ptr @a
; CHECK-NEXT: br label [[WHILE_D]]
; CHECK: if.e:
; CHECK-NEXT: br label [[F]]
@@ -30,7 +30,7 @@ c: ; preds = %f, %0
br i1 undef, label %if.g, label %if.e
if.g: ; preds = %c
- store i32 undef, i32* @a
+ store i32 undef, ptr @a
br label %while.d
if.e: ; preds = %c, %f
diff --git a/llvm/test/Transforms/NewGVN/pr33185.ll b/llvm/test/Transforms/NewGVN/pr33185.ll
index cd02c212de79..edc18281afa5 100644
--- a/llvm/test/Transforms/NewGVN/pr33185.ll
+++ b/llvm/test/Transforms/NewGVN/pr33185.ll
@@ -7,7 +7,7 @@
define i32 @test1() local_unnamed_addr {
; CHECK-LABEL: @test1(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TMP:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[CMP1_I:%.*]] = icmp ne i32 [[TMP]], 0
; CHECK-NEXT: br label [[FOR_BODY_I:%.*]]
; CHECK: for.body.i:
@@ -24,11 +24,11 @@ define i32 @test1() local_unnamed_addr {
; CHECK-NEXT: [[EXITCOND_I:%.*]] = icmp eq i32 [[INC_I]], 4
; CHECK-NEXT: br i1 [[EXITCOND_I]], label [[FN1_EXIT:%.*]], label [[FOR_BODY_I]]
; CHECK: fn1.exit:
-; CHECK-NEXT: [[CALL4:%.*]] = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str4, i64 0, i64 0), i32 [[COND_I]])
+; CHECK-NEXT: [[CALL4:%.*]] = tail call i32 (ptr, ...) @printf(ptr @.str4, i32 [[COND_I]])
; CHECK-NEXT: ret i32 0
;
entry:
- %tmp = load i32, i32* @a, align 4
+ %tmp = load i32, ptr @a, align 4
%cmp1.i = icmp ne i32 %tmp, 0
br label %for.body.i
@@ -51,11 +51,11 @@ cond.end.i:
fn1.exit:
%cond.i.lcssa = phi i32 [ %cond.i, %cond.end.i ]
- %call4= tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str4, i64 0, i64 0), i32 %cond.i.lcssa)
+ %call4= tail call i32 (ptr, ...) @printf(ptr @.str4, i32 %cond.i.lcssa)
ret i32 0
}
-declare i32 @printf(i8* nocapture readonly, ...)
+declare i32 @printf(ptr nocapture readonly, ...)
;; Variant of the above where we have made the udiv available in each predecessor with the wrong values.
;; In the entry block, it is always 0, so we don't try to create a leader there, only in %cond.end.i.
@@ -65,7 +65,7 @@ declare i32 @printf(i8* nocapture readonly, ...)
define i32 @test2() local_unnamed_addr {
; CHECK-LABEL: @test2(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TMP:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[CMP1_I:%.*]] = icmp ne i32 [[TMP]], 0
; CHECK-NEXT: br label [[FOR_BODY_I:%.*]]
; CHECK: for.body.i:
@@ -80,15 +80,15 @@ define i32 @test2() local_unnamed_addr {
; CHECK-NEXT: [[COND_I:%.*]] = phi i32 [ [[DIV_I]], [[COND_TRUE_I]] ], [ 0, [[FOR_BODY_I]] ]
; CHECK-NEXT: [[INC_I]] = add nuw nsw i32 [[F_08_I]], 1
; CHECK-NEXT: [[TEST:%.*]] = udiv i32 [[MUL_I]], [[INC_I]]
-; CHECK-NEXT: [[CALL5:%.*]] = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str4, i64 0, i64 0), i32 [[TEST]])
+; CHECK-NEXT: [[CALL5:%.*]] = tail call i32 (ptr, ...) @printf(ptr @.str4, i32 [[TEST]])
; CHECK-NEXT: [[EXITCOND_I:%.*]] = icmp eq i32 [[INC_I]], 4
; CHECK-NEXT: br i1 [[EXITCOND_I]], label [[FN1_EXIT:%.*]], label [[FOR_BODY_I]]
; CHECK: fn1.exit:
-; CHECK-NEXT: [[CALL4:%.*]] = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str4, i64 0, i64 0), i32 [[COND_I]])
+; CHECK-NEXT: [[CALL4:%.*]] = tail call i32 (ptr, ...) @printf(ptr @.str4, i32 [[COND_I]])
; CHECK-NEXT: ret i32 0
;
entry:
- %tmp = load i32, i32* @a, align 4
+ %tmp = load i32, ptr @a, align 4
%cmp1.i = icmp ne i32 %tmp, 0
br label %for.body.i
@@ -107,13 +107,13 @@ cond.end.i:
%cond.i = phi i32 [ %div.i, %cond.true.i ], [ 0, %for.body.i ]
%inc.i = add nuw nsw i32 %f.08.i, 1
%test = udiv i32 %mul.i, %inc.i
- %call5= tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str4, i64 0, i64 0), i32 %test)
+ %call5= tail call i32 (ptr, ...) @printf(ptr @.str4, i32 %test)
%exitcond.i = icmp eq i32 %inc.i, 4
br i1 %exitcond.i, label %fn1.exit, label %for.body.i
fn1.exit:
%cond.i.lcssa = phi i32 [ %cond.i, %cond.end.i ]
- %call4= tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str4, i64 0, i64 0), i32 %cond.i.lcssa)
+ %call4= tail call i32 (ptr, ...) @printf(ptr @.str4, i32 %cond.i.lcssa)
ret i32 0
}
diff --git a/llvm/test/Transforms/NewGVN/pr33187.ll b/llvm/test/Transforms/NewGVN/pr33187.ll
index b6cb8f28ebee..e5c3da2fb05a 100644
--- a/llvm/test/Transforms/NewGVN/pr33187.ll
+++ b/llvm/test/Transforms/NewGVN/pr33187.ll
@@ -30,7 +30,7 @@ define void @fn1() local_unnamed_addr #0 {
; CHECK: while.body12:
; CHECK-NEXT: br i1 undef, label [[IF_END18]], label [[L]]
; CHECK: L.loopexit:
-; CHECK-NEXT: store i8 poison, i8* null
+; CHECK-NEXT: store i8 poison, ptr null
; CHECK-NEXT: br label [[L]]
; CHECK: L:
; CHECK-NEXT: [[H_125]] = phi i32 [ [[H_127]], [[WHILE_BODY12]] ], [ poison, [[L_LOOPEXIT]] ]
@@ -114,33 +114,33 @@ attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="fals
define void @a() {
; CHECK-LABEL: @a(
; CHECK-NEXT: b:
-; CHECK-NEXT: store i8* null, i8** null
+; CHECK-NEXT: store ptr null, ptr null
; CHECK-NEXT: br label [[D:%.*]]
; CHECK: d:
-; CHECK-NEXT: [[I:%.*]] = phi i8* [ null, [[B:%.*]] ], [ [[E:%.*]], [[F:%.*]] ]
+; CHECK-NEXT: [[I:%.*]] = phi ptr [ null, [[B:%.*]] ], [ [[E:%.*]], [[F:%.*]] ]
; CHECK-NEXT: br i1 undef, label [[F]], label [[G:%.*]]
; CHECK: g:
-; CHECK-NEXT: store i8* [[I]], i8** null
+; CHECK-NEXT: store ptr [[I]], ptr null
; CHECK-NEXT: unreachable
; CHECK: f:
-; CHECK-NEXT: [[E]] = getelementptr i8, i8* [[I]], i64 1
+; CHECK-NEXT: [[E]] = getelementptr i8, ptr [[I]], i64 1
; CHECK-NEXT: br label [[D]]
;
b:
- store i8* null, i8** null
+ store ptr null, ptr null
br label %d
d: ; preds = %f, %b
- %i = phi i8* [ null, %b ], [ %e, %f ]
+ %i = phi ptr [ null, %b ], [ %e, %f ]
br i1 undef, label %f, label %g
g: ; preds = %d
- %h = phi i8* [ %i, %d ]
- store i8* %h, i8** null
+ %h = phi ptr [ %i, %d ]
+ store ptr %h, ptr null
unreachable
f: ; preds = %d
- %e = getelementptr i8, i8* %i, i64 1
+ %e = getelementptr i8, ptr %i, i64 1
br label %d
}
diff --git a/llvm/test/Transforms/NewGVN/pr33196.ll b/llvm/test/Transforms/NewGVN/pr33196.ll
index 1734c455f119..c312d5ec9793 100644
--- a/llvm/test/Transforms/NewGVN/pr33196.ll
+++ b/llvm/test/Transforms/NewGVN/pr33196.ll
@@ -2,8 +2,8 @@
; CHECK: define i32 @main() {
; CHECK-NEXT: entry:
-; CHECK-NEXT: %tmp = load i32, i32* @d, align 4
-; CHECK-NEXT: %tmp1 = load i32, i32* @c, align 4
+; CHECK-NEXT: %tmp = load i32, ptr @d, align 4
+; CHECK-NEXT: %tmp1 = load i32, ptr @c, align 4
; CHECK-NEXT: %tobool = icmp eq i32 %tmp1, -1
; CHECK-NEXT: br i1 %tobool, label %if.end, label %if.then
; CHECK: if.then:
@@ -13,14 +13,14 @@
; CHECK-NEXT: br label %if.end
; CHECK: if.end:
; CHECK-NEXT: %e.1 = phi i32 [ %e.0, %L ], [ %tmp, %entry ]
-; CHECK-NEXT: store i32 %e.1, i32* @a, align 4
-; CHECK-NEXT: %tmp2 = load i32, i32* @b, align 4
-; CHECK-NEXT: store i32 0, i32* @b, align 4
+; CHECK-NEXT: store i32 %e.1, ptr @a, align 4
+; CHECK-NEXT: %tmp2 = load i32, ptr @b, align 4
+; CHECK-NEXT: store i32 0, ptr @b, align 4
; CHECK-NEXT: %sext = shl i32 %tmp2, 16
; CHECK-NEXT: %conv1 = ashr exact i32 %sext, 16
; CHECK-NEXT: %add = add nsw i32 %conv1, %tmp1
; CHECK-NEXT: %add2 = add nsw i32 %add, %e.1
-; CHECK-NEXT: store i32 %add2, i32* @a, align 4
+; CHECK-NEXT: store i32 %add2, ptr @a, align 4
; CHECK-NEXT: %tobool3 = icmp eq i32 %add2, 0
; CHECK-NEXT: br i1 %tobool3, label %if.end5, label %if.then4
; CHECK: if.then4:
@@ -36,8 +36,8 @@
define i32 @main() {
entry:
- %tmp = load i32, i32* @d, align 4
- %tmp1 = load i32, i32* @c, align 4
+ %tmp = load i32, ptr @d, align 4
+ %tmp1 = load i32, ptr @c, align 4
%tobool = icmp eq i32 %tmp1, -1
br i1 %tobool, label %if.end, label %if.then
@@ -50,17 +50,17 @@ L: ; preds = %if.then4, %if.then
if.end: ; preds = %L, %entry
%e.1 = phi i32 [ %e.0, %L ], [ %tmp, %entry ]
- store i32 %e.1, i32* @a, align 4
- %tmp2 = load i32, i32* @b, align 4
- store i32 0, i32* @b, align 4
+ store i32 %e.1, ptr @a, align 4
+ %tmp2 = load i32, ptr @b, align 4
+ store i32 0, ptr @b, align 4
%sext = shl i32 %tmp2, 16
%conv1 = ashr exact i32 %sext, 16
- %tmp3 = load i32, i32* @c, align 4
+ %tmp3 = load i32, ptr @c, align 4
%add = add nsw i32 %conv1, %tmp3
- %tmp4 = load i32, i32* @a, align 4
+ %tmp4 = load i32, ptr @a, align 4
%and = and i32 %tmp4, %e.1
%add2 = add nsw i32 %add, %and
- store i32 %add2, i32* @a, align 4
+ store i32 %add2, ptr @a, align 4
%tobool3 = icmp eq i32 %add2, 0
br i1 %tobool3, label %if.end5, label %if.then4
diff --git a/llvm/test/Transforms/NewGVN/pr33204.ll b/llvm/test/Transforms/NewGVN/pr33204.ll
index cc54beb7a956..99c48241a75c 100644
--- a/llvm/test/Transforms/NewGVN/pr33204.ll
+++ b/llvm/test/Transforms/NewGVN/pr33204.ll
@@ -20,20 +20,20 @@ define void @hoge(i32 %arg) {
; CHECK-NEXT: [[TMP:%.*]] = phi i32 [ 0, [[BB1:%.*]] ], [ [[ARG:%.*]], [[BB:%.*]] ]
; CHECK-NEXT: br label [[BB6:%.*]]
; CHECK: bb3:
-; CHECK-NEXT: [[TMP4:%.*]] = load i32, i32* @global, align 4, !h !0
+; CHECK-NEXT: [[TMP4:%.*]] = load i32, ptr @global, align 4, !h !0
; CHECK-NEXT: unreachable
; CHECK: bb6:
-; CHECK-NEXT: store i32 [[TMP]], i32* @global.1, align 4, !h !0
+; CHECK-NEXT: store i32 [[TMP]], ptr @global.1, align 4, !h !0
; CHECK-NEXT: br i1 undef, label [[BB7:%.*]], label [[BB1]]
; CHECK: bb7:
; CHECK-NEXT: br i1 undef, label [[BB10:%.*]], label [[BB8:%.*]]
; CHECK: bb8:
; CHECK-NEXT: br i1 false, label [[BB9:%.*]], label [[BB3:%.*]]
; CHECK: bb9:
-; CHECK-NEXT: store i8 poison, i8* null, align 1
+; CHECK-NEXT: store i8 poison, ptr null, align 1
; CHECK-NEXT: br label [[BB3]]
; CHECK: bb10:
-; CHECK-NEXT: store i32 0, i32* @global, align 4, !h !0
+; CHECK-NEXT: store i32 0, ptr @global, align 4, !h !0
; CHECK-NEXT: br label [[BB7]]
;
bb:
@@ -47,12 +47,12 @@ bb2: ; preds = %bb1, %bb
br label %bb6
bb3: ; preds = %bb9, %bb8
- %tmp4 = load i32, i32* @global, !h !0
+ %tmp4 = load i32, ptr @global, !h !0
%tmp5 = icmp eq i32 %tmp4, 0
unreachable
bb6: ; preds = %bb2
- store i32 %tmp, i32* @global.1, !h !0
+ store i32 %tmp, ptr @global.1, !h !0
br i1 undef, label %bb7, label %bb1
bb7: ; preds = %bb10, %bb6
@@ -66,7 +66,7 @@ bb9: ; preds = %bb8
br label %bb3
bb10: ; preds = %bb7
- store i32 0, i32* @global, !h !0
+ store i32 0, ptr @global, !h !0
br label %bb7
}
diff --git a/llvm/test/Transforms/NewGVN/pr33305.ll b/llvm/test/Transforms/NewGVN/pr33305.ll
index 79e9994b596a..f87cf08e2abf 100644
--- a/llvm/test/Transforms/NewGVN/pr33305.ll
+++ b/llvm/test/Transforms/NewGVN/pr33305.ll
@@ -6,7 +6,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"
@a = common global i32 0, align 4
- at b = local_unnamed_addr global i32* @a, align 8
+ at b = local_unnamed_addr global ptr @a, align 8
@e = local_unnamed_addr global i32 -1, align 4
@g = local_unnamed_addr global i32 1, align 4
@c = common local_unnamed_addr global i32 0, align 4
@@ -19,14 +19,14 @@ target triple = "x86_64-apple-macosx10.12.0"
define i32 @main() local_unnamed_addr #0 {
; CHECK-LABEL: @main(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[DOTPR_I:%.*]] = load i32, i32* @c, align 4, !tbaa !3
+; CHECK-NEXT: [[DOTPR_I:%.*]] = load i32, ptr @c, align 4, !tbaa !3
; CHECK-NEXT: [[CMP13_I:%.*]] = icmp slt i32 [[DOTPR_I]], 1
; CHECK-NEXT: br i1 [[CMP13_I]], label [[FOR_COND1_PREHEADER_LR_PH_I:%.*]], label [[ENTRY_FOR_END9_I_CRIT_EDGE:%.*]]
; CHECK: entry.for.end9.i_crit_edge:
-; CHECK-NEXT: [[DOTPRE:%.*]] = load i32, i32* @h, align 4, !tbaa !3
+; CHECK-NEXT: [[DOTPRE:%.*]] = load i32, ptr @h, align 4, !tbaa !3
; CHECK-NEXT: br label [[FOR_END9_I:%.*]]
; CHECK: for.cond1.preheader.lr.ph.i:
-; CHECK-NEXT: [[G_PROMOTED14_I:%.*]] = load i32, i32* @g, align 4, !tbaa !3
+; CHECK-NEXT: [[G_PROMOTED14_I:%.*]] = load i32, ptr @g, align 4, !tbaa !3
; CHECK-NEXT: br label [[FOR_COND1_PREHEADER_I:%.*]]
; CHECK: for.cond1.preheader.i:
; CHECK-NEXT: [[INC816_I:%.*]] = phi i32 [ [[DOTPR_I]], [[FOR_COND1_PREHEADER_LR_PH_I]] ], [ [[INC8_I:%.*]], [[FOR_INC7_I:%.*]] ]
@@ -42,9 +42,9 @@ define i32 @main() local_unnamed_addr #0 {
; CHECK: lor.rhs.i:
; CHECK-NEXT: [[LNOT_I:%.*]] = xor i1 [[TOBOOL_I]], true
; CHECK-NEXT: [[LNOT_EXT_I:%.*]] = zext i1 [[LNOT_I]] to i32
-; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* @e, align 4, !tbaa !3
+; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr @e, align 4, !tbaa !3
; CHECK-NEXT: [[XOR_I:%.*]] = xor i32 [[TMP3]], [[LNOT_EXT_I]]
-; CHECK-NEXT: store i32 [[XOR_I]], i32* @e, align 4, !tbaa !3
+; CHECK-NEXT: store i32 [[XOR_I]], ptr @e, align 4, !tbaa !3
; CHECK-NEXT: br label [[LOR_END_I]]
; CHECK: lor.end.i:
; CHECK-NEXT: [[INC_I]] = add nuw nsw i32 [[INC12_I]], 1
@@ -55,44 +55,44 @@ define i32 @main() local_unnamed_addr #0 {
; CHECK-NEXT: [[CMP_I:%.*]] = icmp slt i32 [[INC816_I]], 0
; CHECK-NEXT: br i1 [[CMP_I]], label [[FOR_COND1_PREHEADER_I]], label [[FOR_COND_FOR_END9_CRIT_EDGE_I:%.*]]
; CHECK: for.cond.for.end9_crit_edge.i:
-; CHECK-NEXT: store i32 0, i32* @g, align 4, !tbaa !3
-; CHECK-NEXT: store i32 2, i32* @h, align 4, !tbaa !3
-; CHECK-NEXT: store i32 [[INC8_I]], i32* @c, align 4, !tbaa !3
+; CHECK-NEXT: store i32 0, ptr @g, align 4, !tbaa !3
+; CHECK-NEXT: store i32 2, ptr @h, align 4, !tbaa !3
+; CHECK-NEXT: store i32 [[INC8_I]], ptr @c, align 4, !tbaa !3
; CHECK-NEXT: br label [[FOR_END9_I]]
; CHECK: for.end9.i:
; CHECK-NEXT: [[TMP4:%.*]] = phi i32 [ [[DOTPRE]], [[ENTRY_FOR_END9_I_CRIT_EDGE]] ], [ 2, [[FOR_COND_FOR_END9_CRIT_EDGE_I]] ]
-; CHECK-NEXT: [[TMP5:%.*]] = load i32*, i32** @b, align 8, !tbaa !7
-; CHECK-NEXT: store i32 [[TMP4]], i32* [[TMP5]], align 4, !tbaa !3
-; CHECK-NEXT: [[TMP6:%.*]] = load i32, i32* @e, align 4, !tbaa !3
+; CHECK-NEXT: [[TMP5:%.*]] = load ptr, ptr @b, align 8, !tbaa !7
+; CHECK-NEXT: store i32 [[TMP4]], ptr [[TMP5]], align 4, !tbaa !3
+; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr @e, align 4, !tbaa !3
; CHECK-NEXT: [[CMP10_I:%.*]] = icmp slt i32 [[TMP6]], -1
; CHECK-NEXT: br i1 [[CMP10_I]], label [[IF_THEN_I:%.*]], label [[FN1_EXIT:%.*]]
; CHECK: if.then.i:
-; CHECK-NEXT: [[TMP7:%.*]] = load i32, i32* @f, align 4, !tbaa !3
-; CHECK-NEXT: store i32 [[TMP7]], i32* [[TMP5]], align 4, !tbaa !3
+; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr @f, align 4, !tbaa !3
+; CHECK-NEXT: store i32 [[TMP7]], ptr [[TMP5]], align 4, !tbaa !3
; CHECK-NEXT: br label [[FN1_EXIT]]
; CHECK: fn1.exit:
-; CHECK-NEXT: [[TMP8:%.*]] = load i32, i32* @a, align 4, !tbaa !3
+; CHECK-NEXT: [[TMP8:%.*]] = load i32, ptr @a, align 4, !tbaa !3
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP8]], 0
; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: [[PUTS2:%.*]] = tail call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
+; CHECK-NEXT: [[PUTS2:%.*]] = tail call i32 @puts(ptr @str.2)
; CHECK-NEXT: tail call void @abort()
; CHECK-NEXT: unreachable
; CHECK: if.end:
-; CHECK-NEXT: [[PUTS:%.*]] = tail call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
+; CHECK-NEXT: [[PUTS:%.*]] = tail call i32 @puts(ptr @str)
; CHECK-NEXT: ret i32 0
;
entry:
- %.pr.i = load i32, i32* @c, align 4, !tbaa !3
+ %.pr.i = load i32, ptr @c, align 4, !tbaa !3
%cmp13.i = icmp slt i32 %.pr.i, 1
br i1 %cmp13.i, label %for.cond1.preheader.lr.ph.i, label %entry.for.end9.i_crit_edge
entry.for.end9.i_crit_edge: ; preds = %entry
- %.pre = load i32, i32* @h, align 4, !tbaa !3
+ %.pre = load i32, ptr @h, align 4, !tbaa !3
br label %for.end9.i
for.cond1.preheader.lr.ph.i: ; preds = %entry
- %g.promoted14.i = load i32, i32* @g, align 4, !tbaa !3
+ %g.promoted14.i = load i32, ptr @g, align 4, !tbaa !3
br label %for.cond1.preheader.i
for.cond1.preheader.i: ; preds = %for.inc7.i, %for.cond1.preheader.lr.ph.i
@@ -111,9 +111,9 @@ for.body3.i: ; preds = %lor.end.i, %for.con
lor.rhs.i: ; preds = %for.body3.i
%lnot.i = xor i1 %tobool.i, true
%lnot.ext.i = zext i1 %lnot.i to i32
- %3 = load i32, i32* @e, align 4, !tbaa !3
+ %3 = load i32, ptr @e, align 4, !tbaa !3
%xor.i = xor i32 %3, %lnot.ext.i
- store i32 %xor.i, i32* @e, align 4, !tbaa !3
+ store i32 %xor.i, ptr @e, align 4, !tbaa !3
br label %lor.end.i
lor.end.i: ; preds = %lor.rhs.i, %for.body3.i
@@ -127,36 +127,36 @@ for.inc7.i: ; preds = %lor.end.i
br i1 %cmp.i, label %for.cond1.preheader.i, label %for.cond.for.end9_crit_edge.i
for.cond.for.end9_crit_edge.i: ; preds = %for.inc7.i
- store i32 0, i32* @g, align 4, !tbaa !3
- store i32 2, i32* @h, align 4, !tbaa !3
- store i32 %inc8.i, i32* @c, align 4, !tbaa !3
+ store i32 0, ptr @g, align 4, !tbaa !3
+ store i32 2, ptr @h, align 4, !tbaa !3
+ store i32 %inc8.i, ptr @c, align 4, !tbaa !3
br label %for.end9.i
for.end9.i: ; preds = %entry.for.end9.i_crit_edge, %for.cond.for.end9_crit_edge.i
%4 = phi i32 [ %.pre, %entry.for.end9.i_crit_edge ], [ 2, %for.cond.for.end9_crit_edge.i ]
- %5 = load i32*, i32** @b, align 8, !tbaa !7
- store i32 %4, i32* %5, align 4, !tbaa !3
- %6 = load i32, i32* @e, align 4, !tbaa !3
+ %5 = load ptr, ptr @b, align 8, !tbaa !7
+ store i32 %4, ptr %5, align 4, !tbaa !3
+ %6 = load i32, ptr @e, align 4, !tbaa !3
%cmp10.i = icmp slt i32 %6, -1
br i1 %cmp10.i, label %if.then.i, label %fn1.exit
if.then.i: ; preds = %for.end9.i
- %7 = load i32, i32* @f, align 4, !tbaa !3
- store i32 %7, i32* %5, align 4, !tbaa !3
+ %7 = load i32, ptr @f, align 4, !tbaa !3
+ store i32 %7, ptr %5, align 4, !tbaa !3
br label %fn1.exit
fn1.exit: ; preds = %if.then.i, %for.end9.i
- %8 = load i32, i32* @a, align 4, !tbaa !3
+ %8 = load i32, ptr @a, align 4, !tbaa !3
%tobool = icmp eq i32 %8, 0
br i1 %tobool, label %if.end, label %if.then
if.then: ; preds = %fn1.exit
- %puts2 = tail call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
+ %puts2 = tail call i32 @puts(ptr @str.2)
tail call void @abort() #3
unreachable
if.end: ; preds = %fn1.exit
- %puts = tail call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
+ %puts = tail call i32 @puts(ptr @str)
ret i32 0
}
@@ -164,7 +164,7 @@ if.end: ; preds = %fn1.exit
declare void @abort() local_unnamed_addr #1
; Function Attrs: nounwind
-declare i32 @puts(i8* nocapture readonly) local_unnamed_addr #2
+declare i32 @puts(ptr nocapture readonly) local_unnamed_addr #2
attributes #0 = { nounwind optsize ssp uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+fxsr,+mmx,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { noreturn nounwind optsize "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+fxsr,+mmx,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
diff --git a/llvm/test/Transforms/NewGVN/pr33367.ll b/llvm/test/Transforms/NewGVN/pr33367.ll
index 8a5ddf4c91cd..dc5d190291e1 100644
--- a/llvm/test/Transforms/NewGVN/pr33367.ll
+++ b/llvm/test/Transforms/NewGVN/pr33367.ll
@@ -1,31 +1,29 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -aa-pipeline=basic-aa -passes=newgvn -S %s | FileCheck %s
; Verify that we don't accidentally delete intrinsics that aren't SSA copies
-%DS_struct = type { [32 x i64*], i8, [32 x i16] }
-%MNR_struct = type { i64, i64, %DS_struct* }
+%DS_struct = type { [32 x ptr], i8, [32 x i16] }
+%MNR_struct = type { i64, i64, ptr }
declare i64 @llvm.x86.bmi.bextr.64(i64, i64) #3
-define %MNR_struct @f000316011717_2(%DS_struct* %pDS, [64 x i64]* %pCG) #2 {
+define %MNR_struct @f000316011717_2(ptr %pDS, ptr %pCG) #2 {
; CHECK-LABEL: @f000316011717_2(
; CHECK-NEXT: Entry:
; CHECK-NEXT: [[RESTART:%.*]] = alloca [[MNR_STRUCT:%.*]], align 8
-; CHECK-NEXT: [[PCARRY:%.*]] = getelementptr [[DS_STRUCT:%.*]], %DS_struct* [[PDS:%.*]], i32 0, i32 1
-; CHECK-NEXT: [[PBRBASE:%.*]] = getelementptr [[DS_STRUCT]], %DS_struct* [[PDS]], i32 0, i32 0
-; CHECK-NEXT: [[PBASE:%.*]] = getelementptr [32 x i64*], [32 x i64*]* [[PBRBASE]], i64 0, i64 0
-; CHECK-NEXT: [[BASE:%.*]] = load i64*, i64** [[PBASE]], align 8, !tbaa !14
-; CHECK-NEXT: [[ABSADDR:%.*]] = getelementptr i64, i64* [[BASE]], i64 9
-; CHECK-NEXT: [[EXTARGET:%.*]] = load i64, i64* [[ABSADDR]], align 8, !tbaa !4
+; CHECK-NEXT: [[PCARRY:%.*]] = getelementptr [[DS_STRUCT:%.*]], ptr [[PDS:%.*]], i32 0, i32 1
+; CHECK-NEXT: [[BASE:%.*]] = load ptr, ptr [[PDS]], align 8, !tbaa !14
+; CHECK-NEXT: [[ABSADDR:%.*]] = getelementptr i64, ptr [[BASE]], i64 9
+; CHECK-NEXT: [[EXTARGET:%.*]] = load i64, ptr [[ABSADDR]], align 8, !tbaa !4
; CHECK-NEXT: [[TEMPLATE:%.*]] = icmp eq i64 [[EXTARGET]], 8593987412
; CHECK-NEXT: br i1 [[TEMPLATE]], label %"BB3.000316011731#1", label [[BB2_000316011731_5:%.*]]
; CHECK: "BB3.000316011731#1":
-; CHECK-NEXT: [[PBASE8:%.*]] = getelementptr [32 x i64*], [32 x i64*]* [[PBRBASE]], i64 0, i64 29
-; CHECK-NEXT: [[BASE9:%.*]] = load i64*, i64** [[PBASE8]], align 8, !tbaa !14
-; CHECK-NEXT: [[ABSADDR1:%.*]] = getelementptr i64, i64* [[BASE9]], i64 7
-; CHECK-NEXT: [[RMEM:%.*]] = load i64, i64* [[ABSADDR1]], align 8, !tbaa !4
-; CHECK-NEXT: [[PWT:%.*]] = getelementptr [[DS_STRUCT]], %DS_struct* [[PDS]], i32 0, i32 2
-; CHECK-NEXT: [[PWTE:%.*]] = getelementptr [32 x i16], [32 x i16]* [[PWT]], i64 0, i64 8593987412
-; CHECK-NEXT: [[SHIFTS:%.*]] = load i16, i16* [[PWTE]], align 2, !tbaa !18, !invariant.load !20
+; CHECK-NEXT: [[PBASE8:%.*]] = getelementptr [32 x ptr], ptr [[PDS]], i64 0, i64 29
+; CHECK-NEXT: [[BASE9:%.*]] = load ptr, ptr [[PBASE8]], align 8, !tbaa !14
+; CHECK-NEXT: [[ABSADDR1:%.*]] = getelementptr i64, ptr [[BASE9]], i64 7
+; CHECK-NEXT: [[RMEM:%.*]] = load i64, ptr [[ABSADDR1]], align 8, !tbaa !4
+; CHECK-NEXT: [[PWT:%.*]] = getelementptr [[DS_STRUCT]], ptr [[PDS]], i32 0, i32 2
+; CHECK-NEXT: [[PWTE:%.*]] = getelementptr [32 x i16], ptr [[PWT]], i64 0, i64 8593987412
+; CHECK-NEXT: [[SHIFTS:%.*]] = load i16, ptr [[PWTE]], align 2, !tbaa !18, !invariant.load !20
; CHECK-NEXT: [[SLOWJ:%.*]] = icmp eq i16 [[SHIFTS]], 0
; CHECK-NEXT: br i1 [[SLOWJ]], label [[BB2_000316011731_5]], label %"BB3.000316011731#1.1"
; CHECK: BB2.000316011731.5:
@@ -35,44 +33,41 @@ define %MNR_struct @f000316011717_2(%DS_struct* %pDS, [64 x i64]* %pCG) #2 {
; CHECK: "BB3.000316011731#1.1":
; CHECK-NEXT: [[SHIFTS1:%.*]] = zext i16 [[SHIFTS]] to i64
; CHECK-NEXT: [[VAL:%.*]] = call i64 @llvm.x86.bmi.bextr.64(i64 [[RMEM]], i64 [[SHIFTS1]])
-; CHECK-NEXT: [[PREG:%.*]] = getelementptr [64 x i64], [64 x i64]* [[PCG:%.*]], i64 0, i64 12
-; CHECK-NEXT: store i64 [[VAL]], i64* [[PREG]], align 32, !tbaa !10
-; CHECK-NEXT: [[PREG2:%.*]] = getelementptr [64 x i64], [64 x i64]* [[PCG]], i64 0, i64 14
-; CHECK-NEXT: [[REG:%.*]] = load i64, i64* [[PREG2]], align 16, !tbaa !12
-; CHECK-NEXT: [[BASE2:%.*]] = load i64*, i64** [[PBASE8]], align 8, !tbaa !14
-; CHECK-NEXT: [[ABSADDR2:%.*]] = getelementptr i64, i64* [[BASE2]], i64 [[REG]]
-; CHECK-NEXT: [[RMEM2:%.*]] = load i64, i64* [[ABSADDR2]], align 8, !tbaa !1
-; CHECK-NEXT: [[PREG7:%.*]] = getelementptr [64 x i64], [64 x i64]* [[PCG]], i64 0, i64 9
-; CHECK-NEXT: store i64 [[RMEM2]], i64* [[PREG7]], align 8, !tbaa !8
+; CHECK-NEXT: [[PREG:%.*]] = getelementptr [64 x i64], ptr [[PCG:%.*]], i64 0, i64 12
+; CHECK-NEXT: store i64 [[VAL]], ptr [[PREG]], align 32, !tbaa !10
+; CHECK-NEXT: [[PREG2:%.*]] = getelementptr [64 x i64], ptr [[PCG]], i64 0, i64 14
+; CHECK-NEXT: [[REG:%.*]] = load i64, ptr [[PREG2]], align 16, !tbaa !12
+; CHECK-NEXT: [[BASE2:%.*]] = load ptr, ptr [[PBASE8]], align 8, !tbaa !14
+; CHECK-NEXT: [[ABSADDR2:%.*]] = getelementptr i64, ptr [[BASE2]], i64 [[REG]]
+; CHECK-NEXT: [[RMEM2:%.*]] = load i64, ptr [[ABSADDR2]], align 8, !tbaa !1
+; CHECK-NEXT: [[PREG7:%.*]] = getelementptr [64 x i64], ptr [[PCG]], i64 0, i64 9
+; CHECK-NEXT: store i64 [[RMEM2]], ptr [[PREG7]], align 8, !tbaa !8
; CHECK-NEXT: [[ADD2C279:%.*]] = add i64 [[RMEM2]], [[VAL]]
; CHECK-NEXT: [[CCHK:%.*]] = icmp sge i64 [[ADD2C279]], 0
; CHECK-NEXT: [[CFL:%.*]] = zext i1 [[CCHK]] to i8
-; CHECK-NEXT: store i8 [[CFL]], i8* [[PCARRY]], align 1, !tbaa !16
+; CHECK-NEXT: store i8 [[CFL]], ptr [[PCARRY]], align 1, !tbaa !16
; CHECK-NEXT: br label [[EXIT]]
; CHECK: Exit:
-; CHECK-NEXT: [[RESTART378:%.*]] = load [[MNR_STRUCT]], %MNR_struct* [[RESTART]], align 8
+; CHECK-NEXT: [[RESTART378:%.*]] = load [[MNR_STRUCT]], ptr [[RESTART]], align 8
; CHECK-NEXT: ret [[MNR_STRUCT]] %restart378
;
Entry:
%restart = alloca %MNR_struct
- %pCarry = getelementptr %DS_struct, %DS_struct* %pDS, i32 0, i32 1
- %pBRBase = getelementptr %DS_struct, %DS_struct* %pDS, i32 0, i32 0
- %pbase = getelementptr [32 x i64*], [32 x i64*]* %pBRBase, i64 0, i64 0
- %base = load i64*, i64** %pbase, !tbaa !142
- %absaddr = getelementptr i64, i64* %base, i64 9
- %extarget = load i64, i64* %absaddr, align 8, !tbaa !4
+ %pCarry = getelementptr %DS_struct, ptr %pDS, i32 0, i32 1
+ %base = load ptr, ptr %pDS, !tbaa !142
+ %absaddr = getelementptr i64, ptr %base, i64 9
+ %extarget = load i64, ptr %absaddr, align 8, !tbaa !4
%template = icmp eq i64 %extarget, 8593987412
br i1 %template, label %"BB3.000316011731#1", label %BB2.000316011731.5
"BB3.000316011731#1":
- %pBRBase7 = getelementptr %DS_struct, %DS_struct* %pDS, i32 0, i32 0
- %pbase8 = getelementptr [32 x i64*], [32 x i64*]* %pBRBase7, i64 0, i64 29
- %base9 = load i64*, i64** %pbase8, !tbaa !142
- %absaddr1 = getelementptr i64, i64* %base9, i64 7
- %rmem = load i64, i64* %absaddr1, align 8, !tbaa !4
- %pwt = getelementptr %DS_struct, %DS_struct* %pDS, i32 0, i32 2
- %pwte = getelementptr [32 x i16], [32 x i16]* %pwt, i64 0, i64 %extarget
- %shifts = load i16, i16* %pwte, align 2, !tbaa !175, !invariant.load !181
+ %pbase8 = getelementptr [32 x ptr], ptr %pDS, i64 0, i64 29
+ %base9 = load ptr, ptr %pbase8, !tbaa !142
+ %absaddr1 = getelementptr i64, ptr %base9, i64 7
+ %rmem = load i64, ptr %absaddr1, align 8, !tbaa !4
+ %pwt = getelementptr %DS_struct, ptr %pDS, i32 0, i32 2
+ %pwte = getelementptr [32 x i16], ptr %pwt, i64 0, i64 %extarget
+ %shifts = load i16, ptr %pwte, align 2, !tbaa !175, !invariant.load !181
%slowj = icmp eq i16 %shifts, 0
br i1 %slowj, label %BB2.000316011731.5, label %"BB3.000316011731#1.1"
@@ -84,28 +79,27 @@ BB2.000316011731.5:
"BB3.000316011731#1.1":
%shifts1 = zext i16 %shifts to i64
%val = call i64 @llvm.x86.bmi.bextr.64(i64 %rmem, i64 %shifts1)
- %preg = getelementptr [64 x i64], [64 x i64]* %pCG, i64 0, i64 12
- store i64 %val, i64* %preg, align 32, !tbaa !32
- %preg2 = getelementptr [64 x i64], [64 x i64]* %pCG, i64 0, i64 14
- %reg = load i64, i64* %preg2, align 16, !tbaa !36
- %pBRBase2 = getelementptr %DS_struct, %DS_struct* %pDS, i32 0, i32 0
- %pbase2 = getelementptr [32 x i64*], [32 x i64*]* %pBRBase2, i64 0, i64 29
- %base2 = load i64*, i64** %pbase2, !tbaa !142
- %absaddr2 = getelementptr i64, i64* %base2, i64 %reg
- %rmem2 = load i64, i64* %absaddr2, align 8, !tbaa !4
- %preg7 = getelementptr [64 x i64], [64 x i64]* %pCG, i64 0, i64 9
- store i64 %rmem2, i64* %preg7, align 8, !tbaa !26
- %reg7 = load i64, i64* %preg7, align 8, !tbaa !26
- %preg3 = getelementptr [64 x i64], [64 x i64]* %pCG, i64 0, i64 12
- %reg4 = load i64, i64* %preg3, align 32, !tbaa !32
+ %preg = getelementptr [64 x i64], ptr %pCG, i64 0, i64 12
+ store i64 %val, ptr %preg, align 32, !tbaa !32
+ %preg2 = getelementptr [64 x i64], ptr %pCG, i64 0, i64 14
+ %reg = load i64, ptr %preg2, align 16, !tbaa !36
+ %pbase2 = getelementptr [32 x ptr], ptr %pDS, i64 0, i64 29
+ %base2 = load ptr, ptr %pbase2, !tbaa !142
+ %absaddr2 = getelementptr i64, ptr %base2, i64 %reg
+ %rmem2 = load i64, ptr %absaddr2, align 8, !tbaa !4
+ %preg7 = getelementptr [64 x i64], ptr %pCG, i64 0, i64 9
+ store i64 %rmem2, ptr %preg7, align 8, !tbaa !26
+ %reg7 = load i64, ptr %preg7, align 8, !tbaa !26
+ %preg3 = getelementptr [64 x i64], ptr %pCG, i64 0, i64 12
+ %reg4 = load i64, ptr %preg3, align 32, !tbaa !32
%add2c279 = add i64 %reg7, %reg4
%cchk = icmp sge i64 %add2c279, 0
%cfl = zext i1 %cchk to i8
- store i8 %cfl, i8* %pCarry, align 1, !tbaa !156
+ store i8 %cfl, ptr %pCarry, align 1, !tbaa !156
br label %Exit
Exit:
- %restart378 = load %MNR_struct, %MNR_struct* %restart
+ %restart378 = load %MNR_struct, ptr %restart
ret %MNR_struct %restart378
}
diff --git a/llvm/test/Transforms/NewGVN/pr33432.ll b/llvm/test/Transforms/NewGVN/pr33432.ll
index 4c7a67b9f7d0..c03faef94a74 100644
--- a/llvm/test/Transforms/NewGVN/pr33432.ll
+++ b/llvm/test/Transforms/NewGVN/pr33432.ll
@@ -6,7 +6,7 @@
define void @patatino() {
; CHECK-LABEL: @patatino(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @d, align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @d, align 4
; CHECK-NEXT: br label [[FOR_END10:%.*]]
; CHECK: for.end10:
; CHECK-NEXT: [[OR:%.*]] = or i32 [[TMP0]], 8
@@ -15,7 +15,7 @@ define void @patatino() {
; CHECK-NEXT: ret void
;
entry:
- %0 = load i32, i32* @d, align 4
+ %0 = load i32, ptr @d, align 4
br label %for.end10
for.end10:
diff --git a/llvm/test/Transforms/NewGVN/pr33461.ll b/llvm/test/Transforms/NewGVN/pr33461.ll
index 9537db60f6a1..29d56c8245dd 100644
--- a/llvm/test/Transforms/NewGVN/pr33461.ll
+++ b/llvm/test/Transforms/NewGVN/pr33461.ll
@@ -9,28 +9,28 @@ define void @patatino() {
; CHECK-NEXT: br i1 false, label [[FOR_COND1:%.*]], label [[FOR_INC:%.*]]
; CHECK: for.cond1:
; CHECK-NEXT: [[PHIOFOPS:%.*]] = phi i16 [ poison, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_INC]] ]
-; CHECK-NEXT: store i16 [[PHIOFOPS]], i16* @b, align 2
+; CHECK-NEXT: store i16 [[PHIOFOPS]], ptr @b, align 2
; CHECK-NEXT: br label [[FOR_INC]]
; CHECK: for.inc:
-; CHECK-NEXT: [[TMP0:%.*]] = load i16, i16* @b, align 2
+; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr @b, align 2
; CHECK-NEXT: [[INC]] = add i16 [[TMP0]], 1
-; CHECK-NEXT: store i16 [[INC]], i16* @b, align 2
+; CHECK-NEXT: store i16 [[INC]], ptr @b, align 2
; CHECK-NEXT: br label [[FOR_COND1]]
;
entry:
br i1 false, label %for.cond1, label %for.inc
for.cond1:
- %e.0 = phi i16* [ %e.1, %for.inc ], [ null, %entry ]
- %0 = load i16, i16* %e.0, align 2
+ %e.0 = phi ptr [ %e.1, %for.inc ], [ null, %entry ]
+ %0 = load i16, ptr %e.0, align 2
%add = add i16 %0, 0
- store i16 %add, i16* %e.0, align 2
+ store i16 %add, ptr %e.0, align 2
br label %for.inc
for.inc:
- %e.1 = phi i16* [ %e.0, %for.cond1 ], [ @b, %entry ]
- %1 = load i16, i16* @b, align 2
+ %e.1 = phi ptr [ %e.0, %for.cond1 ], [ @b, %entry ]
+ %1 = load i16, ptr @b, align 2
%inc = add i16 %1, 1
- store i16 %inc, i16* @b, align 2
+ store i16 %inc, ptr @b, align 2
br label %for.cond1
}
diff --git a/llvm/test/Transforms/NewGVN/pr33720.ll b/llvm/test/Transforms/NewGVN/pr33720.ll
index bd59c4fe4069..d1bcd311c5a0 100644
--- a/llvm/test/Transforms/NewGVN/pr33720.ll
+++ b/llvm/test/Transforms/NewGVN/pr33720.ll
@@ -18,26 +18,26 @@ define void @patatino() {
; CHECK: for.body:
; CHECK-NEXT: [[CMP3:%.*]] = icmp ne i64 [[K_2:%.*]], 3
; CHECK-NEXT: [[CONV4:%.*]] = zext i1 [[CMP3]] to i64
-; CHECK-NEXT: [[TMP0:%.*]] = load i64, i64* @f, align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr @f, align 4
; CHECK-NEXT: [[OR:%.*]] = or i64 [[TMP0]], [[CONV4]]
-; CHECK-NEXT: store i64 [[OR]], i64* @f, align 4
+; CHECK-NEXT: store i64 [[OR]], ptr @f, align 4
; CHECK-NEXT: [[TOBOOL7:%.*]] = icmp ne i64 [[K_2]], 0
; CHECK-NEXT: br i1 [[TOBOOL7]], label [[FOR_COND2THREAD_PRE_SPLIT:%.*]], label [[LOR_RHS:%.*]]
; CHECK: lor.rhs:
-; CHECK-NEXT: store i64 1, i64* @b, align 8
+; CHECK-NEXT: store i64 1, ptr @b, align 8
; CHECK-NEXT: br label [[FOR_COND2THREAD_PRE_SPLIT]]
; CHECK: l1:
; CHECK-NEXT: [[K_2]] = phi i64 [ undef, [[L1_PREHEADER:%.*]] ], [ 15, [[FOR_COND8_PREHEADER]] ], [ 5, [[FOR_COND11THREAD_PRE_SPLIT_LR_PH]] ]
-; CHECK-NEXT: store i64 7, i64* [[J_3:%.*]], align 4
+; CHECK-NEXT: store i64 7, ptr [[J_3:%.*]], align 4
; CHECK-NEXT: br label [[FOR_BODY]]
; CHECK: for.cond16:
-; CHECK-NEXT: [[J_0:%.*]] = phi i64* [ @f, [[ENTRY:%.*]] ], [ poison, [[FOR_COND20:%.*]] ], [ @e, [[FOR_COND16]] ]
+; CHECK-NEXT: [[J_0:%.*]] = phi ptr [ @f, [[ENTRY:%.*]] ], [ poison, [[FOR_COND20:%.*]] ], [ @e, [[FOR_COND16]] ]
; CHECK-NEXT: br i1 undef, label [[FOR_COND20]], label [[FOR_COND16]]
; CHECK: for.cond20:
-; CHECK-NEXT: [[J_2:%.*]] = phi i64* [ [[J_0]], [[FOR_COND16]] ], [ poison, [[IF_END24]] ]
+; CHECK-NEXT: [[J_2:%.*]] = phi ptr [ [[J_0]], [[FOR_COND16]] ], [ poison, [[IF_END24]] ]
; CHECK-NEXT: br i1 true, label [[IF_END24]], label [[FOR_COND16]]
; CHECK: if.end24:
-; CHECK-NEXT: [[J_3]] = phi i64* [ [[J_2]], [[FOR_COND20]] ], [ undef, [[ENTRY]] ]
+; CHECK-NEXT: [[J_3]] = phi ptr [ [[J_2]], [[FOR_COND20]] ], [ undef, [[ENTRY]] ]
; CHECK-NEXT: br i1 false, label [[FOR_COND20]], label [[L1_PREHEADER]]
; CHECK: l1.preheader:
; CHECK-NEXT: br label [[L1]]
@@ -58,32 +58,32 @@ for.body:
%k.031 = phi i64 [ %k.2, %l1 ], [ 15, %for.cond2thread-pre-split ]
%cmp3 = icmp ne i64 %k.031, 3
%conv4 = zext i1 %cmp3 to i64
- %0 = load i64, i64* @f
+ %0 = load i64, ptr @f
%or = or i64 %0, %conv4
- store i64 %or, i64* @f
+ store i64 %or, ptr @f
%tobool7 = icmp ne i64 %k.031, 0
%or.cond = or i1 %tobool7, false
br i1 %or.cond, label %for.cond2thread-pre-split, label %lor.rhs
lor.rhs:
- store i64 1, i64* @b, align 8
+ store i64 1, ptr @b, align 8
br label %for.cond2thread-pre-split
l1:
%k.2 = phi i64 [ undef, %l1.preheader ], [ 15, %for.cond8.preheader ], [ 5, %for.cond11thread-pre-split.lr.ph ]
- store i64 7, i64* %j.3
+ store i64 7, ptr %j.3
br label %for.body
for.cond16:
- %j.0 = phi i64* [ @f, %entry ], [ %j.2, %for.cond20 ], [ @e, %for.cond16 ]
+ %j.0 = phi ptr [ @f, %entry ], [ %j.2, %for.cond20 ], [ @e, %for.cond16 ]
br i1 undef, label %for.cond20, label %for.cond16
for.cond20:
- %j.2 = phi i64* [ %j.0, %for.cond16 ], [ %j.3, %if.end24 ]
+ %j.2 = phi ptr [ %j.0, %for.cond16 ], [ %j.3, %if.end24 ]
br i1 true, label %if.end24, label %for.cond16
if.end24:
- %j.3 = phi i64* [ %j.2, %for.cond20 ], [ undef, %entry ]
+ %j.3 = phi ptr [ %j.2, %for.cond20 ], [ undef, %entry ]
br i1 false, label %for.cond20, label %l1.preheader
l1.preheader:
diff --git a/llvm/test/Transforms/NewGVN/pr34452.ll b/llvm/test/Transforms/NewGVN/pr34452.ll
index 8fd1a493652a..f5d5fda34303 100644
--- a/llvm/test/Transforms/NewGVN/pr34452.ll
+++ b/llvm/test/Transforms/NewGVN/pr34452.ll
@@ -9,7 +9,7 @@ source_filename = "bugpoint-output-09f7a24.bc"
define void @sgrep() local_unnamed_addr #0 {
; CHECK-LABEL: @sgrep(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @WHOLELINE, align 4, !tbaa !1
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @WHOLELINE, align 4, !tbaa !1
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0
; CHECK-NEXT: [[DOT:%.*]] = select i1 [[TOBOOL]], i32 2048, i32 2047
; CHECK-NEXT: br label [[WHILE_BODY_US:%.*]]
@@ -20,7 +20,7 @@ define void @sgrep() local_unnamed_addr #0 {
; CHECK-NEXT: br label [[WHILE_BODY_US]]
;
entry:
- %0 = load i32, i32* @WHOLELINE, align 4, !tbaa !1
+ %0 = load i32, ptr @WHOLELINE, align 4, !tbaa !1
%tobool = icmp eq i32 %0, 0
%. = select i1 %tobool, i32 2048, i32 2047
br label %while.body.us
diff --git a/llvm/test/Transforms/NewGVN/pr35125.ll b/llvm/test/Transforms/NewGVN/pr35125.ll
index d402ceb9e01a..9a96594e3446 100644
--- a/llvm/test/Transforms/NewGVN/pr35125.ll
+++ b/llvm/test/Transforms/NewGVN/pr35125.ll
@@ -6,7 +6,7 @@
define i32 @main() #0 {
; CHECK-LABEL: @main(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[NEG:%.*]] = xor i32 [[TMP0]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], -1
; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
@@ -26,15 +26,15 @@ define i32 @main() #0 {
; CHECK-NEXT: br label [[LOR_END]]
; CHECK: lor.end:
; CHECK-NEXT: [[TMP1:%.*]] = phi i32 [ 1, [[IF_THEN3]] ], [ [[PHITMP]], [[LOR_RHS]] ]
-; CHECK-NEXT: store i32 [[TMP1]], i32* @a, align 4
+; CHECK-NEXT: store i32 [[TMP1]], ptr @a, align 4
; CHECK-NEXT: br label [[IF_END6]]
; CHECK: if.end6:
-; CHECK-NEXT: [[TMP2:%.*]] = load i32, i32* @a, align 4
-; CHECK-NEXT: [[CALL:%.*]] = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 [[TMP2]])
+; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr @a, align 4
+; CHECK-NEXT: [[CALL:%.*]] = call i32 (ptr, ...) @printf(ptr @.str, i32 [[TMP2]])
; CHECK-NEXT: ret i32 0
;
entry:
- %0 = load i32, i32* @a, align 4
+ %0 = load i32, ptr @a, align 4
%neg = xor i32 %0, -1
%cmp = icmp sgt i32 %0, -1
br i1 %cmp, label %if.then, label %if.end
@@ -59,12 +59,12 @@ lor.rhs:
lor.end:
%1 = phi i32 [ 1, %if.then3 ], [ %phitmp, %lor.rhs ]
- store i32 %1, i32* @a, align 4
+ store i32 %1, ptr @a, align 4
br label %if.end6
if.end6:
- %2 = load i32, i32* @a, align 4
- %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2) #3
+ %2 = load i32, ptr @a, align 4
+ %call = call i32 (ptr, ...) @printf(ptr @.str, i32 %2) #3
ret i32 0
}
-declare i32 @printf(i8*, ...) #2
+declare i32 @printf(ptr, ...) #2
diff --git a/llvm/test/Transforms/NewGVN/pr37121-seens-this-value-a-lot.ll b/llvm/test/Transforms/NewGVN/pr37121-seens-this-value-a-lot.ll
index a126ca37d35f..1fc484437212 100644
--- a/llvm/test/Transforms/NewGVN/pr37121-seens-this-value-a-lot.ll
+++ b/llvm/test/Transforms/NewGVN/pr37121-seens-this-value-a-lot.ll
@@ -8,11 +8,11 @@ define hidden void @foo() {
; CHECK: if:
; CHECK-NEXT: br i1 false, label [[L50:%.*]], label [[IF]]
; CHECK: L50:
-; CHECK-NEXT: store i8 poison, i8* null, align 1
+; CHECK-NEXT: store i8 poison, ptr null, align 1
; CHECK-NEXT: ret void
;
top:
- %.promoted = load i8, i8* undef, align 8
+ %.promoted = load i8, ptr undef, align 8
br label %if
;; This is really a multi-valued phi, because the phi is defined by an expression of the phi.
@@ -26,6 +26,6 @@ if: ; preds = %if, %top
L50: ; preds = %if
%.lcssa = phi i8 [ %1, %if ]
- store i8 %.lcssa, i8* undef, align 8
+ store i8 %.lcssa, ptr undef, align 8
ret void
}
diff --git a/llvm/test/Transforms/NewGVN/pre-compare.ll b/llvm/test/Transforms/NewGVN/pre-compare.ll
index 9cd265248e83..9fd20fcc76ed 100644
--- a/llvm/test/Transforms/NewGVN/pre-compare.ll
+++ b/llvm/test/Transforms/NewGVN/pre-compare.ll
@@ -43,8 +43,8 @@ entry:
if.then: ; preds = %entry
%cmp1 = icmp eq i32 %x, 2
- %cond = select i1 %cmp1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str1, i64 0, i64 0)
- %call = tail call i32 @puts(i8* %cond) nounwind
+ %cond = select i1 %cmp1, ptr @.str, ptr @.str1
+ %call = tail call i32 @puts(ptr %cond) nounwind
br label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.then
@@ -52,17 +52,17 @@ for.cond.preheader: ; preds = %entry, %if.then
br label %for.cond
for.cond: ; preds = %for.cond.backedge, %for.cond.preheader
- %call2 = tail call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str2, i64 0, i64 0)) nounwind
+ %call2 = tail call i32 @puts(ptr @.str2) nounwind
br i1 %cmp3, label %for.cond.backedge, label %if.end5
if.end5: ; preds = %for.cond
- %call6 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str3, i64 0, i64 0), i32 %x) nounwind
+ %call6 = tail call i32 (ptr, ...) @printf(ptr @.str3, i32 %x) nounwind
br label %for.cond.backedge
for.cond.backedge: ; preds = %if.end5, %for.cond
br label %for.cond
}
-declare i32 @puts(i8* nocapture) nounwind
+declare i32 @puts(ptr nocapture) nounwind
-declare i32 @printf(i8* nocapture, ...) nounwind
+declare i32 @printf(ptr nocapture, ...) nounwind
diff --git a/llvm/test/Transforms/NewGVN/pre-new-inst-xfail.ll b/llvm/test/Transforms/NewGVN/pre-new-inst-xfail.ll
index f69054a5e616..f11d031b50aa 100644
--- a/llvm/test/Transforms/NewGVN/pre-new-inst-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/pre-new-inst-xfail.ll
@@ -2,7 +2,7 @@
; RUN: opt -passes=newgvn -S %s | FileCheck %s
%MyStruct = type { i32, i32 }
-define i8 @foo(i64 %in, i8* %arr) {
+define i8 @foo(i64 %in, ptr %arr) {
%addr = alloca %MyStruct
%dead = trunc i64 %in to i32
br i1 undef, label %next, label %tmp
@@ -12,17 +12,15 @@ tmp:
br label %next
next:
- %addr64 = bitcast %MyStruct* %addr to i64*
- store i64 %in, i64* %addr64
+ store i64 %in, ptr %addr
br label %final
final:
- %addr32 = getelementptr %MyStruct, %MyStruct* %addr, i32 0, i32 0
- %idx32 = load i32, i32* %addr32
+ %idx32 = load i32, ptr %addr
-; CHECK: %resptr = getelementptr i8, i8* %arr, i32 %dead
- %resptr = getelementptr i8, i8* %arr, i32 %idx32
- %res = load i8, i8* %resptr
+; CHECK: %resptr = getelementptr i8, ptr %arr, i32 %dead
+ %resptr = getelementptr i8, ptr %arr, i32 %idx32
+ %res = load i8, ptr %resptr
ret i8 %res
}
diff --git a/llvm/test/Transforms/NewGVN/predicates.ll b/llvm/test/Transforms/NewGVN/predicates.ll
index dae38acaa158..26d08cb1316d 100644
--- a/llvm/test/Transforms/NewGVN/predicates.ll
+++ b/llvm/test/Transforms/NewGVN/predicates.ll
@@ -2,7 +2,7 @@
; RUN: opt -passes=newgvn -S < %s | FileCheck %s
; Function Attrs: noinline norecurse nounwind readonly ssp uwtable
-define i32 @mp_unsgn_cmp(i32 %n, i32* nocapture readonly %in1, i32* nocapture readonly %in2) local_unnamed_addr {
+define i32 @mp_unsgn_cmp(i32 %n, ptr nocapture readonly %in1, ptr nocapture readonly %in2) local_unnamed_addr {
; CHECK-LABEL: @mp_unsgn_cmp(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CMP11:%.*]] = icmp sgt i32 [[N:%.*]], -1
@@ -12,10 +12,10 @@ define i32 @mp_unsgn_cmp(i32 %n, i32* nocapture readonly %in1, i32* nocapture re
; CHECK: for.inc:
; CHECK-NEXT: [[STOREMERGE2:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_INC]] ], [ 0, [[FOR_INC_PREHEADER]] ]
; CHECK-NEXT: [[IDXPROM:%.*]] = sext i32 [[STOREMERGE2]] to i64
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[IN1:%.*]], i64 [[IDXPROM]]
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[ARRAYIDX]], align 4
-; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds i32, i32* [[IN2:%.*]], i64 [[IDXPROM]]
-; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX4]], align 4
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[IN1:%.*]], i64 [[IDXPROM]]
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
+; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds i32, ptr [[IN2:%.*]], i64 [[IDXPROM]]
+; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[ARRAYIDX4]], align 4
; CHECK-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP0]], [[TMP1]]
; CHECK-NEXT: [[INC]] = add nsw i32 [[STOREMERGE2]], 1
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[STOREMERGE2]], [[N]]
@@ -43,10 +43,10 @@ for.inc.preheader: ; preds = %entry
for.inc: ; preds = %for.inc.preheader, %for.inc
%storemerge2 = phi i32 [ %inc, %for.inc ], [ 0, %for.inc.preheader ]
%idxprom = sext i32 %storemerge2 to i64
- %arrayidx = getelementptr inbounds i32, i32* %in1, i64 %idxprom
- %0 = load i32, i32* %arrayidx, align 4
- %arrayidx4 = getelementptr inbounds i32, i32* %in2, i64 %idxprom
- %1 = load i32, i32* %arrayidx4, align 4
+ %arrayidx = getelementptr inbounds i32, ptr %in1, i64 %idxprom
+ %0 = load i32, ptr %arrayidx, align 4
+ %arrayidx4 = getelementptr inbounds i32, ptr %in2, i64 %idxprom
+ %1 = load i32, ptr %arrayidx4, align 4
%sub = sub nsw i32 %0, %1
%inc = add nsw i32 %storemerge2, 1
%cmp1 = icmp slt i32 %storemerge2, %n
diff --git a/llvm/test/Transforms/NewGVN/preserve-metadata-for-predicate-replacements.ll b/llvm/test/Transforms/NewGVN/preserve-metadata-for-predicate-replacements.ll
index bada1aaacc8f..1ca24af84e48 100644
--- a/llvm/test/Transforms/NewGVN/preserve-metadata-for-predicate-replacements.ll
+++ b/llvm/test/Transforms/NewGVN/preserve-metadata-for-predicate-replacements.ll
@@ -6,10 +6,10 @@ declare void @use(i32)
; Make sure !tbaa metadata is preserved when only ssa_copy calls introduced by
; PredicateInfo are replaced.
-define i32 @test(i32* %p1, i32* %p2, i1 %c) {
+define i32 @test(ptr %p1, ptr %p2, i1 %c) {
; CHECK-LABEL: @test(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[LV:%.*]] = load i32, i32* [[P1:%.*]], align 8, !tbaa !0
+; CHECK-NEXT: [[LV:%.*]] = load i32, ptr [[P1:%.*]], align 8, !tbaa !0
; CHECK-NEXT: [[CMP_1:%.*]] = icmp slt i32 [[LV]], 1
; CHECK-NEXT: br i1 [[CMP_1]], label [[EXIT:%.*]], label [[IF_FALSE:%.*]]
; CHECK: if.false:
@@ -29,7 +29,7 @@ define i32 @test(i32* %p1, i32* %p2, i1 %c) {
; CHECK-NEXT: ret i32 [[LV]]
;
entry:
- %lv = load i32, i32* %p1, align 8, !tbaa !0
+ %lv = load i32, ptr %p1, align 8, !tbaa !0
%cmp.1 = icmp slt i32 %lv, 1
br i1 %cmp.1, label %exit, label %if.false
diff --git a/llvm/test/Transforms/NewGVN/propagate-ir-flags.ll b/llvm/test/Transforms/NewGVN/propagate-ir-flags.ll
index a3c845e461ae..fa119c9b34b4 100644
--- a/llvm/test/Transforms/NewGVN/propagate-ir-flags.ll
+++ b/llvm/test/Transforms/NewGVN/propagate-ir-flags.ll
@@ -8,8 +8,8 @@ define double @func_fast(double %a, double %b) {
entry:
%a.addr = alloca double, align 8
%add = fadd fast double %b, 3.000000e+00
- store double %add, double* %a.addr, align 8
- %load_add = load double, double* %a.addr, align 8
+ store double %add, ptr %a.addr, align 8
+ %load_add = load double, ptr %a.addr, align 8
ret double %load_add
}
@@ -21,7 +21,7 @@ define double @func_no_fast(double %a, double %b) {
entry:
%a.addr = alloca double, align 8
%add = fadd fast double %b, 3.000000e+00
- store double %add, double* %a.addr, align 8
+ store double %add, ptr %a.addr, align 8
%duplicated_add = fadd double %b, 3.000000e+00
ret double %duplicated_add
}
diff --git a/llvm/test/Transforms/NewGVN/range.ll b/llvm/test/Transforms/NewGVN/range.ll
index 6f44cc47363b..4adfa3da7c1f 100644
--- a/llvm/test/Transforms/NewGVN/range.ll
+++ b/llvm/test/Transforms/NewGVN/range.ll
@@ -1,82 +1,82 @@
; RUN: opt -passes=newgvn -S < %s | FileCheck %s
-define i32 @test1(i32* %p) {
-; CHECK-LABEL: @test1(i32* %p)
-; CHECK: %a = load i32, i32* %p, align 4, !range ![[RANGE0:[0-9]+]]
+define i32 @test1(ptr %p) {
+; CHECK-LABEL: @test1(ptr %p)
+; CHECK: %a = load i32, ptr %p, align 4, !range ![[RANGE0:[0-9]+]]
; CHECK: %c = add i32 %a, %a
- %a = load i32, i32* %p, !range !0
- %b = load i32, i32* %p, !range !0
+ %a = load i32, ptr %p, !range !0
+ %b = load i32, ptr %p, !range !0
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test2(i32* %p) {
-; CHECK-LABEL: @test2(i32* %p)
-; CHECK: %a = load i32, i32* %p, align 4, !range ![[RANGE0]]
+define i32 @test2(ptr %p) {
+; CHECK-LABEL: @test2(ptr %p)
+; CHECK: %a = load i32, ptr %p, align 4, !range ![[RANGE0]]
; CHECK: %c = add i32 %a, %a
- %a = load i32, i32* %p, !range !0
- %b = load i32, i32* %p
+ %a = load i32, ptr %p, !range !0
+ %b = load i32, ptr %p
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test3(i32* %p) {
-; CHECK-LABEL: @test3(i32* %p)
-; CHECK: %a = load i32, i32* %p, align 4, !range ![[RANGE0]]
+define i32 @test3(ptr %p) {
+; CHECK-LABEL: @test3(ptr %p)
+; CHECK: %a = load i32, ptr %p, align 4, !range ![[RANGE0]]
; CHECK: %c = add i32 %a, %a
- %a = load i32, i32* %p, !range !0
- %b = load i32, i32* %p, !range !1
+ %a = load i32, ptr %p, !range !0
+ %b = load i32, ptr %p, !range !1
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test4(i32* %p) {
-; CHECK-LABEL: @test4(i32* %p)
-; CHECK: %a = load i32, i32* %p, align 4, !range ![[RANGE0]]
+define i32 @test4(ptr %p) {
+; CHECK-LABEL: @test4(ptr %p)
+; CHECK: %a = load i32, ptr %p, align 4, !range ![[RANGE0]]
; CHECK: %c = add i32 %a, %a
- %a = load i32, i32* %p, !range !0
- %b = load i32, i32* %p, !range !2
+ %a = load i32, ptr %p, !range !0
+ %b = load i32, ptr %p, !range !2
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test5(i32* %p) {
-; CHECK-LABEL: @test5(i32* %p)
-; CHECK: %a = load i32, i32* %p, align 4, !range ![[RANGE3:[0-9]+]]
+define i32 @test5(ptr %p) {
+; CHECK-LABEL: @test5(ptr %p)
+; CHECK: %a = load i32, ptr %p, align 4, !range ![[RANGE3:[0-9]+]]
; CHECK: %c = add i32 %a, %a
- %a = load i32, i32* %p, !range !3
- %b = load i32, i32* %p, !range !4
+ %a = load i32, ptr %p, !range !3
+ %b = load i32, ptr %p, !range !4
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test6(i32* %p) {
-; CHECK-LABEL: @test6(i32* %p)
-; CHECK: %a = load i32, i32* %p, align 4, !range ![[RANGE5:[0-9]+]]
+define i32 @test6(ptr %p) {
+; CHECK-LABEL: @test6(ptr %p)
+; CHECK: %a = load i32, ptr %p, align 4, !range ![[RANGE5:[0-9]+]]
; CHECK: %c = add i32 %a, %a
- %a = load i32, i32* %p, !range !5
- %b = load i32, i32* %p, !range !6
+ %a = load i32, ptr %p, !range !5
+ %b = load i32, ptr %p, !range !6
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test7(i32* %p) {
-; CHECK-LABEL: @test7(i32* %p)
-; CHECK: %a = load i32, i32* %p, align 4, !range ![[RANGE7:[0-9]+]]
+define i32 @test7(ptr %p) {
+; CHECK-LABEL: @test7(ptr %p)
+; CHECK: %a = load i32, ptr %p, align 4, !range ![[RANGE7:[0-9]+]]
; CHECK: %c = add i32 %a, %a
- %a = load i32, i32* %p, !range !7
- %b = load i32, i32* %p, !range !8
+ %a = load i32, ptr %p, !range !7
+ %b = load i32, ptr %p, !range !8
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test8(i32* %p) {
-; CHECK-LABEL: @test8(i32* %p)
-; CHECK: %a = load i32, i32* %p, align 4, !range ![[RANGE9:[0-9]+]]
+define i32 @test8(ptr %p) {
+; CHECK-LABEL: @test8(ptr %p)
+; CHECK: %a = load i32, ptr %p, align 4, !range ![[RANGE9:[0-9]+]]
; CHECK-NOT: range
; CHECK: %c = add i32 %a, %a
- %a = load i32, i32* %p, !range !9
- %b = load i32, i32* %p, !range !10
+ %a = load i32, ptr %p, !range !9
+ %b = load i32, ptr %p, !range !10
%c = add i32 %a, %b
ret i32 %c
}
diff --git a/llvm/test/Transforms/NewGVN/readattrs.ll b/llvm/test/Transforms/NewGVN/readattrs.ll
index 790b9dea8a35..049a2fc91168 100644
--- a/llvm/test/Transforms/NewGVN/readattrs.ll
+++ b/llvm/test/Transforms/NewGVN/readattrs.ll
@@ -3,15 +3,15 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-unknown-linux-gnu"
-declare void @use(i8* readonly nocapture)
+declare void @use(ptr readonly nocapture)
define i8 @test() {
%a = alloca i8
- store i8 1, i8* %a
- call void @use(i8* %a)
- %b = load i8, i8* %a
+ store i8 1, ptr %a
+ call void @use(ptr %a)
+ %b = load i8, ptr %a
ret i8 %b
; CHECK-LABEL: define i8 @test(
-; CHECK: call void @use(i8* %a)
+; CHECK: call void @use(ptr %a)
; CHECK-NEXT: ret i8 1
}
diff --git a/llvm/test/Transforms/NewGVN/rle-must-alias-xfail.ll b/llvm/test/Transforms/NewGVN/rle-must-alias-xfail.ll
index 3b405554fac6..956bc7d7c60c 100644
--- a/llvm/test/Transforms/NewGVN/rle-must-alias-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/rle-must-alias-xfail.ll
@@ -7,8 +7,8 @@
; The %7 and %4 loads combine to make %DEAD unneeded.
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin7"
- at H = common global [100 x i32] zeroinitializer, align 32 ; <[100 x i32]*> [#uses=3]
- at G = common global i32 0 ; <i32*> [#uses=2]
+ at H = common global [100 x i32] zeroinitializer, align 32 ; <ptr> [#uses=3]
+ at G = common global i32 0 ; <ptr> [#uses=2]
define i32 @test(i32 %i) nounwind {
entry:
@@ -18,22 +18,22 @@ entry:
bb: ; preds = %entry
%2 = tail call i32 (...) @bar() nounwind ; <i32> [#uses=0]
- %3 = getelementptr [100 x i32], [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1]
- %4 = load i32, i32* %3, align 4 ; <i32> [#uses=1]
- store i32 %4, i32* @G, align 4
+ %3 = getelementptr [100 x i32], ptr @H, i32 0, i32 %i ; <ptr> [#uses=1]
+ %4 = load i32, ptr %3, align 4 ; <i32> [#uses=1]
+ store i32 %4, ptr @G, align 4
br label %bb3
bb1: ; preds = %entry
%5 = tail call i32 (...) @baz() nounwind ; <i32> [#uses=0]
- %6 = getelementptr [100 x i32], [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1]
- %7 = load i32, i32* %6, align 4 ; <i32> [#uses=2]
- store i32 %7, i32* @G, align 4
+ %6 = getelementptr [100 x i32], ptr @H, i32 0, i32 %i ; <ptr> [#uses=1]
+ %7 = load i32, ptr %6, align 4 ; <i32> [#uses=2]
+ store i32 %7, ptr @G, align 4
%8 = icmp eq i32 %7, 0 ; <i1> [#uses=1]
br i1 %8, label %bb3, label %bb4
bb3: ; preds = %bb1, %bb
- %9 = getelementptr [100 x i32], [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1]
- %DEAD = load i32, i32* %9, align 4 ; <i32> [#uses=1]
+ %9 = getelementptr [100 x i32], ptr @H, i32 0, i32 %i ; <ptr> [#uses=1]
+ %DEAD = load i32, ptr %9, align 4 ; <i32> [#uses=1]
; CHECK: %DEAD = phi i32 [ 0, %bb1 ], [ %4, %bb ]
ret i32 %DEAD
diff --git a/llvm/test/Transforms/NewGVN/rle-no-phi-translate-xfail.ll b/llvm/test/Transforms/NewGVN/rle-no-phi-translate-xfail.ll
index fb05792ac275..ffc2bb516714 100644
--- a/llvm/test/Transforms/NewGVN/rle-no-phi-translate-xfail.ll
+++ b/llvm/test/Transforms/NewGVN/rle-no-phi-translate-xfail.ll
@@ -6,20 +6,20 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin7"
-define i32 @g(i32* %b, i32* %c) nounwind {
+define i32 @g(ptr %b, ptr %c) nounwind {
entry:
- store i32 1, i32* %b
- store i32 2, i32* %c
+ store i32 1, ptr %b
+ store i32 2, ptr %c
- %t1 = icmp eq i32* %b, null ; <i1> [#uses=1]
+ %t1 = icmp eq ptr %b, null ; <i1> [#uses=1]
br i1 %t1, label %bb, label %bb2
bb: ; preds = %entry
br label %bb2
bb2: ; preds = %bb1, %bb
- %c_addr.0 = phi i32* [ %b, %entry ], [ %c, %bb ] ; <i32*> [#uses=1]
- %cv = load i32, i32* %c_addr.0, align 4 ; <i32> [#uses=1]
+ %c_addr.0 = phi ptr [ %b, %entry ], [ %c, %bb ] ; <ptr> [#uses=1]
+ %cv = load i32, ptr %c_addr.0, align 4 ; <i32> [#uses=1]
ret i32 %cv
; CHECK: bb2:
; CHECK-NOT: load i32
diff --git a/llvm/test/Transforms/NewGVN/rle-nonlocal.ll b/llvm/test/Transforms/NewGVN/rle-nonlocal.ll
index 2f20fbc92f50..c2fb39100da4 100644
--- a/llvm/test/Transforms/NewGVN/rle-nonlocal.ll
+++ b/llvm/test/Transforms/NewGVN/rle-nonlocal.ll
@@ -1,20 +1,20 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
-define i32 @main(i32** %p, i32 %x, i32 %y) {
+define i32 @main(ptr %p, i32 %x, i32 %y) {
; CHECK-LABEL: @main(
; CHECK-NEXT: block1:
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: br i1 [[CMP]], label [[BLOCK2:%.*]], label [[BLOCK3:%.*]]
; CHECK: block2:
-; CHECK-NEXT: [[A:%.*]] = load i32*, i32** [[P:%.*]]
+; CHECK-NEXT: [[A:%.*]] = load ptr, ptr [[P:%.*]]
; CHECK-NEXT: br label [[BLOCK4:%.*]]
; CHECK: block3:
-; CHECK-NEXT: [[B:%.*]] = load i32*, i32** [[P]]
+; CHECK-NEXT: [[B:%.*]] = load ptr, ptr [[P]]
; CHECK-NEXT: br label [[BLOCK4]]
; CHECK: block4:
-; CHECK-NEXT: [[EXISTINGPHI:%.*]] = phi i32* [ [[A]], [[BLOCK2]] ], [ [[B]], [[BLOCK3]] ]
-; CHECK-NEXT: [[C:%.*]] = load i32, i32* [[EXISTINGPHI]]
+; CHECK-NEXT: [[EXISTINGPHI:%.*]] = phi ptr [ [[A]], [[BLOCK2]] ], [ [[B]], [[BLOCK3]] ]
+; CHECK-NEXT: [[C:%.*]] = load i32, ptr [[EXISTINGPHI]]
; CHECK-NEXT: [[E:%.*]] = add i32 [[C]], [[C]]
; CHECK-NEXT: ret i32 [[E]]
;
@@ -23,18 +23,18 @@ block1:
br i1 %cmp , label %block2, label %block3
block2:
- %a = load i32*, i32** %p
+ %a = load ptr, ptr %p
br label %block4
block3:
- %b = load i32*, i32** %p
+ %b = load ptr, ptr %p
br label %block4
block4:
- %existingPHI = phi i32* [ %a, %block2 ], [ %b, %block3 ]
- %DEAD = load i32*, i32** %p
- %c = load i32, i32* %DEAD
- %d = load i32, i32* %existingPHI
+ %existingPHI = phi ptr [ %a, %block2 ], [ %b, %block3 ]
+ %DEAD = load ptr, ptr %p
+ %c = load i32, ptr %DEAD
+ %d = load i32, ptr %existingPHI
%e = add i32 %c, %d
ret i32 %e
}
diff --git a/llvm/test/Transforms/NewGVN/rle.ll b/llvm/test/Transforms/NewGVN/rle.ll
index cccf97e381b2..1cfdc83f40da 100644
--- a/llvm/test/Transforms/NewGVN/rle.ll
+++ b/llvm/test/Transforms/NewGVN/rle.ll
@@ -1,12 +1,11 @@
; RUN: opt < %s -data-layout="e-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-n8:16:32" -passes=newgvn,dce -S | FileCheck %s
; RUN: opt < %s -data-layout="E-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-n32" -passes=newgvn,dce -S | FileCheck %s
; memset -> i16 forwarding.
-define signext i16 @memset_to_i16_local(i16* %A) nounwind ssp {
+define signext i16 @memset_to_i16_local(ptr %A) nounwind ssp {
entry:
- %conv = bitcast i16* %A to i8*
- tail call void @llvm.memset.p0i8.i64(i8* %conv, i8 1, i64 200, i1 false)
- %arrayidx = getelementptr inbounds i16, i16* %A, i64 42
- %tmp2 = load i16, i16* %arrayidx
+ tail call void @llvm.memset.p0.i64(ptr %A, i8 1, i64 200, i1 false)
+ %arrayidx = getelementptr inbounds i16, ptr %A, i64 42
+ %tmp2 = load i16, ptr %arrayidx
ret i16 %tmp2
; CHECK-LABEL: @memset_to_i16_local(
; CHECK-NOT: load
@@ -17,24 +16,22 @@ entry:
@GCst_as1 = addrspace(1) constant {i32, float, i32 } { i32 42, float 14., i32 97 }
; memset -> float forwarding.
-define float @memcpy_to_float_local(float* %A) nounwind ssp {
+define float @memcpy_to_float_local(ptr %A) nounwind ssp {
entry:
- %conv = bitcast float* %A to i8* ; <i8*> [#uses=1]
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %conv, i8* bitcast ({i32, float, i32 }* @GCst to i8*), i64 12, i1 false)
- %arrayidx = getelementptr inbounds float, float* %A, i64 1 ; <float*> [#uses=1]
- %tmp2 = load float, float* %arrayidx ; <float> [#uses=1]
+ tail call void @llvm.memcpy.p0.p0.i64(ptr %A, ptr @GCst, i64 12, i1 false)
+ %arrayidx = getelementptr inbounds float, ptr %A, i64 1 ; <ptr> [#uses=1]
+ %tmp2 = load float, ptr %arrayidx ; <float> [#uses=1]
ret float %tmp2
; CHECK-LABEL: @memcpy_to_float_local(
; CHECK-NOT: load
; CHECK: ret float 1.400000e+01
}
; memcpy from address space 1
-define float @memcpy_to_float_local_as1(float* %A) nounwind ssp {
+define float @memcpy_to_float_local_as1(ptr %A) nounwind ssp {
entry:
- %conv = bitcast float* %A to i8* ; <i8*> [#uses=1]
- tail call void @llvm.memcpy.p0i8.p1i8.i64(i8* %conv, i8 addrspace(1)* bitcast ({i32, float, i32 } addrspace(1)* @GCst_as1 to i8 addrspace(1)*), i64 12, i1 false)
- %arrayidx = getelementptr inbounds float, float* %A, i64 1 ; <float*> [#uses=1]
- %tmp2 = load float, float* %arrayidx ; <float> [#uses=1]
+ tail call void @llvm.memcpy.p0.p1.i64(ptr %A, ptr addrspace(1) @GCst_as1, i64 12, i1 false)
+ %arrayidx = getelementptr inbounds float, ptr %A, i64 1 ; <ptr> [#uses=1]
+ %tmp2 = load float, ptr %arrayidx ; <float> [#uses=1]
ret float %tmp2
; CHECK-LABEL: @memcpy_to_float_local_as1(
; CHECK-NOT: load
@@ -44,16 +41,15 @@ entry:
; PR6642
define i32 @memset_to_load() nounwind readnone {
entry:
- %x = alloca [256 x i32], align 4 ; <[256 x i32]*> [#uses=2]
- %tmp = bitcast [256 x i32]* %x to i8* ; <i8*> [#uses=1]
- call void @llvm.memset.p0i8.i64(i8* align 4 %tmp, i8 0, i64 1024, i1 false)
- %arraydecay = getelementptr inbounds [256 x i32], [256 x i32]* %x, i32 0, i32 0 ; <i32*>
- %tmp1 = load i32, i32* %arraydecay ; <i32> [#uses=1]
+ %x = alloca [256 x i32], align 4 ; <ptr> [#uses=2]
+ call void @llvm.memset.p0.i64(ptr align 4 %x, i8 0, i64 1024, i1 false)
+ %arraydecay = getelementptr inbounds [256 x i32], ptr %x, i32 0, i32 0 ; <ptr>
+ %tmp1 = load i32, ptr %arraydecay ; <i32> [#uses=1]
ret i32 %tmp1
; CHECK-LABEL: @memset_to_load(
; CHECK: ret i32 0
}
-declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind
+declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) nounwind
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
-declare void @llvm.memcpy.p0i8.p1i8.i64(i8* nocapture, i8 addrspace(1)* nocapture, i64, i1) nounwind
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounwind
+declare void @llvm.memcpy.p0.p1.i64(ptr nocapture, ptr addrspace(1) nocapture, i64, i1) nounwind
diff --git a/llvm/test/Transforms/NewGVN/simp-to-self.ll b/llvm/test/Transforms/NewGVN/simp-to-self.ll
index 73a19b2d9b02..fb8a01962959 100644
--- a/llvm/test/Transforms/NewGVN/simp-to-self.ll
+++ b/llvm/test/Transforms/NewGVN/simp-to-self.ll
@@ -1,7 +1,7 @@
; RUN: opt -S < %s -passes=newgvn | FileCheck %s
; CHECK-LABEL: for.cond:
-; CHECK-NEXT: %lv = load i32, i32* bitcast (i64* @a to i32*)
+; CHECK-NEXT: %lv = load i32, ptr @a
; CHECK-NEXT: %bf.clear = and i32 %lv, -131072
; CHECK-NEXT: %bf.set = or i32 1, %bf.clear
; CHECK-NEXT: br i1 %bc, label %for.cond, label %exit
@@ -14,7 +14,7 @@ entry:
for.cond: ; preds = %for.cond1.1, %entry
%tmp = phi i1 [ undef, %entry ], [ 1, %for.cond ]
%conv = zext i1 %tmp to i32
- %lv = load i32, i32* bitcast (i64* @a to i32*)
+ %lv = load i32, ptr @a
%bf.clear = and i32 %lv, -131072
%bf.set = or i32 %conv, %bf.clear
%bf.clear.1 = and i32 %bf.set, -131072
@@ -22,6 +22,6 @@ for.cond: ; preds = %for.cond1.1, %entry
br i1 %bc, label %for.cond, label %exit
exit: ; preds = %for.cond1
- store i32 %bf.set.1, i32* bitcast (i64* @a to i32*)
+ store i32 %bf.set.1, ptr @a
ret void
}
diff --git a/llvm/test/Transforms/NewGVN/sq-ctxi.ll b/llvm/test/Transforms/NewGVN/sq-ctxi.ll
index ef7380437176..1804cc4db092 100644
--- a/llvm/test/Transforms/NewGVN/sq-ctxi.ll
+++ b/llvm/test/Transforms/NewGVN/sq-ctxi.ll
@@ -2,20 +2,20 @@
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
; github issue #56039
-define i8 @src(i8* %a, i8* %b, i1 %c) {
+define i8 @src(ptr %a, ptr %b, i1 %c) {
; CHECK-LABEL: @src(
; CHECK-NEXT: br i1 [[C:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[LB1:%.*]] = load i8, i8* [[B:%.*]], align 1
+; CHECK-NEXT: [[LB1:%.*]] = load i8, ptr [[B:%.*]], align 1
; CHECK-NEXT: [[TOBOOL3_NOT_I:%.*]] = icmp eq i8 [[LB1]], 0
; CHECK-NEXT: br i1 [[TOBOOL3_NOT_I]], label [[BB4:%.*]], label [[BB3:%.*]]
; CHECK: bb2:
-; CHECK-NEXT: [[LB2:%.*]] = load i8, i8* [[B]], align 1
+; CHECK-NEXT: [[LB2:%.*]] = load i8, ptr [[B]], align 1
; CHECK-NEXT: [[CMP_NOT_I:%.*]] = icmp ult i8 0, [[LB2]]
; CHECK-NEXT: tail call void @llvm.assume(i1 [[CMP_NOT_I]])
; CHECK-NEXT: br label [[BB3]]
; CHECK: bb3:
-; CHECK-NEXT: [[LA:%.*]] = load i8, i8* [[A:%.*]], align 1
+; CHECK-NEXT: [[LA:%.*]] = load i8, ptr [[A:%.*]], align 1
; CHECK-NEXT: br label [[BB4]]
; CHECK: bb4:
; CHECK-NEXT: ret i8 0
@@ -23,19 +23,19 @@ define i8 @src(i8* %a, i8* %b, i1 %c) {
br i1 %c, label %bb1, label %bb2
bb1:
- %lb1 = load i8, i8* %b
+ %lb1 = load i8, ptr %b
%tobool3.not.i = icmp eq i8 %lb1, 0
br i1 %tobool3.not.i, label %bb4, label %bb3
bb2:
- %lb2 = load i8, i8* %b
+ %lb2 = load i8, ptr %b
%cmp.not.i = icmp ult i8 0, %lb2
tail call void @llvm.assume(i1 %cmp.not.i)
br label %bb3
bb3:
%p = phi i8 [ %lb1, %bb1 ], [ %lb2, %bb2 ]
- %la = load i8, i8* %a
+ %la = load i8, ptr %a
%xor = xor i8 %la, %p
br label %bb4
diff --git a/llvm/test/Transforms/NewGVN/stale-loop-info.ll b/llvm/test/Transforms/NewGVN/stale-loop-info.ll
index 757eb1f4f22e..8870824d38ad 100644
--- a/llvm/test/Transforms/NewGVN/stale-loop-info.ll
+++ b/llvm/test/Transforms/NewGVN/stale-loop-info.ll
@@ -11,15 +11,14 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
%struct.zot.882 = type { [64 x i8] }
; Function Attrs: argmemonly
-declare void @snork.1(i8*) local_unnamed_addr #0
+declare void @snork.1(ptr) local_unnamed_addr #0
-define hidden zeroext i1 @eggs(%struct.wibble.1028* %arg, i1 %arg2) unnamed_addr align 2 {
+define hidden zeroext i1 @eggs(ptr %arg, i1 %arg2) unnamed_addr align 2 {
bb:
br i1 %arg2, label %bb14, label %bb3
bb3: ; preds = %bb
- %tmp = getelementptr inbounds %struct.wibble.1028, %struct.wibble.1028* %arg, i64 0, i32 2, i32 0, i32 0, i64 0
- %tmp5 = bitcast i8* %tmp to %struct.wibble.1028**
+ %tmp = getelementptr inbounds %struct.wibble.1028, ptr %arg, i64 0, i32 2, i32 0, i32 0, i64 0
br label %bb6
bb6: ; preds = %bb12, %bb3
@@ -29,17 +28,16 @@ bb7: ; preds = %bb6
br i1 undef, label %bb11, label %bb8
bb8: ; preds = %bb7
- %tmp9 = load %struct.wibble.1028*, %struct.wibble.1028** %tmp5, align 8
-; CHECK: %tmp9 = load %struct.wibble.1028*, %struct.wibble.1028** %tmp5, align 8
- %tmp10 = bitcast %struct.wibble.1028* %tmp9 to i8*
+ %tmp9 = load ptr, ptr %tmp, align 8
+; CHECK: %tmp9 = load ptr, ptr %tmp, align 8
br label %bb12
bb11: ; preds = %bb7
br label %bb12
bb12: ; preds = %bb11, %bb8
- %tmp13 = phi i8* [ %tmp, %bb11 ], [ %tmp10, %bb8 ]
- call void @snork.1(i8* %tmp13) #1
+ %tmp13 = phi ptr [ %tmp, %bb11 ], [ %tmp9, %bb8 ]
+ call void @snork.1(ptr %tmp13) #1
br label %bb6
bb14: ; preds = %bb
diff --git a/llvm/test/Transforms/NewGVN/storeoverstore.ll b/llvm/test/Transforms/NewGVN/storeoverstore.ll
index 8d8168a49a87..0e31739b04e3 100644
--- a/llvm/test/Transforms/NewGVN/storeoverstore.ll
+++ b/llvm/test/Transforms/NewGVN/storeoverstore.ll
@@ -7,9 +7,9 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
;; All the loads in this testcase are useless, but it requires understanding that repeated
;; stores of the same value do not change the memory state to eliminate them.
-define i32 @foo(i32*, i32) {
+define i32 @foo(ptr, i32) {
; CHECK-LABEL: @foo(
-; CHECK-NEXT: store i32 5, i32* [[TMP0:%.*]], align 4
+; CHECK-NEXT: store i32 5, ptr [[TMP0:%.*]], align 4
; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP1:%.*]], 0
; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]]
; CHECK: 4:
@@ -24,23 +24,23 @@ define i32 @foo(i32*, i32) {
; CHECK-NEXT: [[DOT1:%.*]] = phi i32 [ [[TMP7]], [[TMP6]] ], [ [[DOT0]], [[TMP5]] ]
; CHECK-NEXT: ret i32 [[DOT1]]
;
- store i32 5, i32* %0, align 4
+ store i32 5, ptr %0, align 4
%3 = icmp ne i32 %1, 0
br i1 %3, label %4, label %7
; <label>:4: ; preds = %2
- %5 = load i32, i32* %0, align 4
+ %5 = load i32, ptr %0, align 4
%6 = add nsw i32 5, %5
br label %7
; <label>:7: ; preds = %4, %2
%.0 = phi i32 [ %6, %4 ], [ 5, %2 ]
- store i32 5, i32* %0, align 4
+ store i32 5, ptr %0, align 4
%8 = icmp ne i32 %1, 0
br i1 %8, label %9, label %12
; <label>:9: ; preds = %7
- %10 = load i32, i32* %0, align 4
+ %10 = load i32, ptr %0, align 4
%11 = add nsw i32 %.0, %10
br label %12
@@ -51,9 +51,9 @@ define i32 @foo(i32*, i32) {
;; This is similar to the above, but it is a conditional store of the same value
;; which requires value numbering MemoryPhi properly to resolve.
-define i32 @foo2(i32*, i32) {
+define i32 @foo2(ptr, i32) {
; CHECK-LABEL: @foo2(
-; CHECK-NEXT: store i32 5, i32* [[TMP0:%.*]], align 4
+; CHECK-NEXT: store i32 5, ptr [[TMP0:%.*]], align 4
; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP1:%.*]], 0
; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]]
; CHECK: 4:
@@ -70,17 +70,17 @@ define i32 @foo2(i32*, i32) {
; CHECK-NEXT: [[DOT1:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ [[DOT0]], [[TMP6]] ]
; CHECK-NEXT: ret i32 [[DOT1]]
;
- store i32 5, i32* %0, align 4
+ store i32 5, ptr %0, align 4
%3 = icmp ne i32 %1, 0
br i1 %3, label %4, label %7
; <label>:4: ; preds = %2
- %5 = load i32, i32* %0, align 4
+ %5 = load i32, ptr %0, align 4
%6 = add nsw i32 5, %5
br label %8
; <label>:7: ; preds = %2
- store i32 5, i32* %0, align 4
+ store i32 5, ptr %0, align 4
br label %8
; <label>:8: ; preds = %7, %4
@@ -89,7 +89,7 @@ define i32 @foo2(i32*, i32) {
br i1 %9, label %10, label %13
; <label>:10: ; preds = %8
- %11 = load i32, i32* %0, align 4
+ %11 = load i32, ptr %0, align 4
%12 = add nsw i32 %.0, %11
br label %13
diff --git a/llvm/test/Transforms/NewGVN/tbaa.ll b/llvm/test/Transforms/NewGVN/tbaa.ll
index 0a43a3976ba8..e6d66dca0dec 100644
--- a/llvm/test/Transforms/NewGVN/tbaa.ll
+++ b/llvm/test/Transforms/NewGVN/tbaa.ll
@@ -1,119 +1,119 @@
; RUN: opt -passes=newgvn -S < %s | FileCheck %s
-define i32 @test1(i8* %p, i8* %q) {
-; CHECK-LABEL: @test1(i8* %p, i8* %q)
-; CHECK: call i32 @foo(i8* %p)
+define i32 @test1(ptr %p, ptr %q) {
+; CHECK-LABEL: @test1(ptr %p, ptr %q)
+; CHECK: call i32 @foo(ptr %p)
; CHECK-NOT: tbaa
; CHECK: %c = add i32 %a, %a
- %a = call i32 @foo(i8* %p), !tbaa !0
- %b = call i32 @foo(i8* %p)
+ %a = call i32 @foo(ptr %p), !tbaa !0
+ %b = call i32 @foo(ptr %p)
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test2(i8* %p, i8* %q) {
-; CHECK-LABEL: @test2(i8* %p, i8* %q)
-; CHECK: call i32 @foo(i8* %p), !tbaa [[TAGC:!.*]]
+define i32 @test2(ptr %p, ptr %q) {
+; CHECK-LABEL: @test2(ptr %p, ptr %q)
+; CHECK: call i32 @foo(ptr %p), !tbaa [[TAGC:!.*]]
; CHECK: %c = add i32 %a, %a
- %a = call i32 @foo(i8* %p), !tbaa !0
- %b = call i32 @foo(i8* %p), !tbaa !0
+ %a = call i32 @foo(ptr %p), !tbaa !0
+ %b = call i32 @foo(ptr %p), !tbaa !0
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test3(i8* %p, i8* %q) {
-; CHECK-LABEL: @test3(i8* %p, i8* %q)
-; CHECK: call i32 @foo(i8* %p), !tbaa [[TAGB:!.*]]
+define i32 @test3(ptr %p, ptr %q) {
+; CHECK-LABEL: @test3(ptr %p, ptr %q)
+; CHECK: call i32 @foo(ptr %p), !tbaa [[TAGB:!.*]]
; CHECK: %c = add i32 %a, %a
- %a = call i32 @foo(i8* %p), !tbaa !3
- %b = call i32 @foo(i8* %p), !tbaa !3
+ %a = call i32 @foo(ptr %p), !tbaa !3
+ %b = call i32 @foo(ptr %p), !tbaa !3
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test4(i8* %p, i8* %q) {
-; CHECK-LABEL: @test4(i8* %p, i8* %q)
-; CHECK: call i32 @foo(i8* %p), !tbaa [[TAGA:!.*]]
+define i32 @test4(ptr %p, ptr %q) {
+; CHECK-LABEL: @test4(ptr %p, ptr %q)
+; CHECK: call i32 @foo(ptr %p), !tbaa [[TAGA:!.*]]
; CHECK: %c = add i32 %a, %a
- %a = call i32 @foo(i8* %p), !tbaa !1
- %b = call i32 @foo(i8* %p), !tbaa !0
+ %a = call i32 @foo(ptr %p), !tbaa !1
+ %b = call i32 @foo(ptr %p), !tbaa !0
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test5(i8* %p, i8* %q) {
-; CHECK-LABEL: @test5(i8* %p, i8* %q)
-; CHECK: call i32 @foo(i8* %p), !tbaa [[TAGA]]
+define i32 @test5(ptr %p, ptr %q) {
+; CHECK-LABEL: @test5(ptr %p, ptr %q)
+; CHECK: call i32 @foo(ptr %p), !tbaa [[TAGA]]
; CHECK: %c = add i32 %a, %a
- %a = call i32 @foo(i8* %p), !tbaa !0
- %b = call i32 @foo(i8* %p), !tbaa !1
+ %a = call i32 @foo(ptr %p), !tbaa !0
+ %b = call i32 @foo(ptr %p), !tbaa !1
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test6(i8* %p, i8* %q) {
-; CHECK-LABEL: @test6(i8* %p, i8* %q)
-; CHECK: call i32 @foo(i8* %p), !tbaa [[TAGA]]
+define i32 @test6(ptr %p, ptr %q) {
+; CHECK-LABEL: @test6(ptr %p, ptr %q)
+; CHECK: call i32 @foo(ptr %p), !tbaa [[TAGA]]
; CHECK: %c = add i32 %a, %a
- %a = call i32 @foo(i8* %p), !tbaa !0
- %b = call i32 @foo(i8* %p), !tbaa !3
+ %a = call i32 @foo(ptr %p), !tbaa !0
+ %b = call i32 @foo(ptr %p), !tbaa !3
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test7(i8* %p, i8* %q) {
-; CHECK-LABEL: @test7(i8* %p, i8* %q)
-; CHECK: call i32 @foo(i8* %p)
+define i32 @test7(ptr %p, ptr %q) {
+; CHECK-LABEL: @test7(ptr %p, ptr %q)
+; CHECK: call i32 @foo(ptr %p)
; CHECK-NOT: tbaa
; CHECK: %c = add i32 %a, %a
- %a = call i32 @foo(i8* %p), !tbaa !4
- %b = call i32 @foo(i8* %p), !tbaa !3
+ %a = call i32 @foo(ptr %p), !tbaa !4
+ %b = call i32 @foo(ptr %p), !tbaa !3
%c = add i32 %a, %b
ret i32 %c
}
-define i32 @test8(i32* %p, i32* %q) {
+define i32 @test8(ptr %p, ptr %q) {
; CHECK-LABEL: @test8
-; CHECK-NEXT: store i32 15, i32* %p
+; CHECK-NEXT: store i32 15, ptr %p
; CHECK-NEXT: ret i32 0
; Since we know the location is invariant, we can forward the
; load across the potentially aliasing store.
- %a = load i32, i32* %q, !tbaa !10
- store i32 15, i32* %p
- %b = load i32, i32* %q, !tbaa !10
+ %a = load i32, ptr %q, !tbaa !10
+ store i32 15, ptr %p
+ %b = load i32, ptr %q, !tbaa !10
%c = sub i32 %a, %b
ret i32 %c
}
-define i32 @test9(i32* %p, i32* %q) {
+define i32 @test9(ptr %p, ptr %q) {
; CHECK-LABEL: @test9
; CHECK-NEXT: call void @clobber()
; CHECK-NEXT: ret i32 0
; Since we know the location is invariant, we can forward the
; load across the potentially aliasing store (within the call).
- %a = load i32, i32* %q, !tbaa !10
+ %a = load i32, ptr %q, !tbaa !10
call void @clobber()
- %b = load i32, i32* %q, !tbaa !10
+ %b = load i32, ptr %q, !tbaa !10
%c = sub i32 %a, %b
ret i32 %c
}
-define i32 @test10(i8* %p, i8* %q) {
+define i32 @test10(ptr %p, ptr %q) {
; If one access encloses the other, then the merged access is the enclosed one
; and not just the common final access type.
; CHECK-LABEL: @test10
-; CHECK: call i32 @foo(i8* %p), !tbaa [[TAG_X_i:!.*]]
+; CHECK: call i32 @foo(ptr %p), !tbaa [[TAG_X_i:!.*]]
; CHECK: %c = add i32 %a, %a
- %a = call i32 @foo(i8* %p), !tbaa !15 ; TAG_X_i
- %b = call i32 @foo(i8* %p), !tbaa !19 ; TAG_Y_x_i
+ %a = call i32 @foo(ptr %p), !tbaa !15 ; TAG_X_i
+ %b = call i32 @foo(ptr %p), !tbaa !19 ; TAG_Y_x_i
%c = add i32 %a, %b
ret i32 %c
}
declare void @clobber()
-declare i32 @foo(i8*) readonly
+declare i32 @foo(ptr) readonly
; CHECK-DAG: [[TAGC]] = !{[[TYPEC:!.*]], [[TYPEC]], i64 0}
; CHECK-DAG: [[TYPEC]] = !{!"C", [[TYPEA:!.*]]}
diff --git a/llvm/test/Transforms/NewGVN/verify-memoryphi.ll b/llvm/test/Transforms/NewGVN/verify-memoryphi.ll
index c6c70f962ef1..b863d23cffdc 100644
--- a/llvm/test/Transforms/NewGVN/verify-memoryphi.ll
+++ b/llvm/test/Transforms/NewGVN/verify-memoryphi.ll
@@ -7,21 +7,21 @@
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 false, label %body, label %end
; CHECK: body:
-; CHECK-NEXT: store i8 poison, i8* null
+; CHECK-NEXT: store i8 poison, ptr null
; CHECK-NEXT: br label %end
; CHECK: end:
; CHECK-NEXT: ret void
; CHECK-NEXT: }
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
define void @tinkywinky() {
entry:
- call void @llvm.lifetime.start.p0i8(i64 4, i8* undef)
+ call void @llvm.lifetime.start.p0(i64 4, ptr undef)
br i1 false, label %body, label %end
body:
- call void @llvm.lifetime.start.p0i8(i64 4, i8* undef)
+ call void @llvm.lifetime.start.p0(i64 4, ptr undef)
br label %end
end:
diff --git a/llvm/test/Transforms/NewGVN/volatile-nonvolatile.ll b/llvm/test/Transforms/NewGVN/volatile-nonvolatile.ll
index ab531dc7e701..2febea7e9481 100644
--- a/llvm/test/Transforms/NewGVN/volatile-nonvolatile.ll
+++ b/llvm/test/Transforms/NewGVN/volatile-nonvolatile.ll
@@ -1,19 +1,18 @@
; RUN: opt -passes=newgvn -S < %s | FileCheck %s
-%struct.t = type { i32* }
+%struct.t = type { ptr }
; The loaded address and the location of the address itself are not aliased,
; so the second reload is not necessary. Check that it can be eliminated.
; CHECK-LABEL: test1
; CHECK: load
; CHECK-NOT: load
-define void @test1(%struct.t* nocapture readonly %p, i32 %v) #0 {
+define void @test1(ptr nocapture readonly %p, i32 %v) #0 {
entry:
- %m = getelementptr inbounds %struct.t, %struct.t* %p, i32 0, i32 0
- %0 = load i32*, i32** %m, align 4, !tbaa !1
- store volatile i32 %v, i32* %0, align 4, !tbaa !6
- %1 = load i32*, i32** %m, align 4, !tbaa !1
- store volatile i32 %v, i32* %1, align 4, !tbaa !6
+ %0 = load ptr, ptr %p, align 4, !tbaa !1
+ store volatile i32 %v, ptr %0, align 4, !tbaa !6
+ %1 = load ptr, ptr %p, align 4, !tbaa !1
+ store volatile i32 %v, ptr %1, align 4, !tbaa !6
ret void
}
@@ -23,13 +22,12 @@ entry:
; CHECK: load
; CHECK: store
; CHECK: load
-define void @test2(%struct.t* nocapture readonly %p, i32 %v) #0 {
+define void @test2(ptr nocapture readonly %p, i32 %v) #0 {
entry:
- %m = getelementptr inbounds %struct.t, %struct.t* %p, i32 0, i32 0
- %0 = load i32*, i32** %m, align 4, !tbaa !1
- store volatile i32 %v, i32* %0, align 4, !tbaa !1
- %1 = load i32*, i32** %m, align 4, !tbaa !1
- store volatile i32 %v, i32* %1, align 4, !tbaa !1
+ %0 = load ptr, ptr %p, align 4, !tbaa !1
+ store volatile i32 %v, ptr %0, align 4, !tbaa !1
+ %1 = load ptr, ptr %p, align 4, !tbaa !1
+ store volatile i32 %v, ptr %1, align 4, !tbaa !1
ret void
}
@@ -39,13 +37,12 @@ entry:
; CHECK: load
; CHECK: store
; CHECK: load
-define void @test3(%struct.t* nocapture readonly %p, i32 %v) #0 {
+define void @test3(ptr nocapture readonly %p, i32 %v) #0 {
entry:
- %m = getelementptr inbounds %struct.t, %struct.t* %p, i32 0, i32 0
- %0 = load atomic i32*, i32** %m acquire, align 4, !tbaa !1
- store volatile i32 %v, i32* %0, align 4, !tbaa !6
- %1 = load atomic i32*, i32** %m acquire, align 4, !tbaa !1
- store volatile i32 %v, i32* %1, align 4, !tbaa !6
+ %0 = load atomic ptr, ptr %p acquire, align 4, !tbaa !1
+ store volatile i32 %v, ptr %0, align 4, !tbaa !6
+ %1 = load atomic ptr, ptr %p acquire, align 4, !tbaa !1
+ store volatile i32 %v, ptr %1, align 4, !tbaa !6
ret void
}
More information about the llvm-commits
mailing list