From fa8448c1b18bfe7ffa89f91ab0cfc16f2f83760d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 4 Jan 2023 16:43:14 +0100 Subject: [PATCH] [NewGVN] Convert some tests to opaque pointers (NFC) --- .../Transforms/NewGVN/2007-07-25-DominatedLoop.ll | 8 +- .../Transforms/NewGVN/2007-07-25-InfiniteLoop.ll | 6 +- llvm/test/Transforms/NewGVN/2007-07-25-Loop.ll | 4 +- .../Transforms/NewGVN/2007-07-25-NestedLoop.ll | 22 +- .../NewGVN/2007-07-25-SinglePredecessor.ll | 14 +- .../Transforms/NewGVN/2007-07-26-NonRedundant.ll | 6 +- .../Transforms/NewGVN/2007-07-26-PhiErasure.ll | 14 +- llvm/test/Transforms/NewGVN/2007-07-30-PredIDom.ll | 36 +-- .../NewGVN/2007-07-31-NoDomInherit-xfail.ll | 322 +++++++++---------- .../Transforms/NewGVN/2007-07-31-RedundantPhi.ll | 8 +- .../NewGVN/2008-02-12-UndefLoad-xfail.ll | 12 +- llvm/test/Transforms/NewGVN/2008-02-13-NewPHI.ll | 14 +- .../Transforms/NewGVN/2008-07-02-Unreachable.ll | 8 +- .../Transforms/NewGVN/2008-12-09-SelfRemove.ll | 20 +- .../test/Transforms/NewGVN/2008-12-12-RLE-Crash.ll | 12 +- .../Transforms/NewGVN/2008-12-14-rle-reanalyze.ll | 8 +- .../Transforms/NewGVN/2008-12-15-CacheVisited.ll | 12 +- .../NewGVN/2009-01-21-SortInvalidation.ll | 12 +- .../NewGVN/2009-01-22-SortInvalidation.ll | 128 ++++---- .../test/Transforms/NewGVN/2009-03-10-PREOnVoid.ll | 76 ++--- .../Transforms/NewGVN/2009-07-13-MemDepSortFail.ll | 28 +- .../NewGVN/2009-11-12-MemDepMallocBitCast.ll | 11 +- .../Transforms/NewGVN/2010-03-31-RedundantPHIs.ll | 10 +- llvm/test/Transforms/NewGVN/2010-05-08-OneBit.ll | 16 +- .../Transforms/NewGVN/2011-04-27-phioperands.ll | 4 +- .../test/Transforms/NewGVN/2011-09-07-TypeIdFor.ll | 42 +-- ...08-30-MaskedScatterGather-xfail-inseltpoison.ll | 28 +- .../NewGVN/2016-08-30-MaskedScatterGather-xfail.ll | 28 +- llvm/test/Transforms/NewGVN/MemdepMiscompile.ll | 22 +- llvm/test/Transforms/NewGVN/addrspacecast.ll | 96 +++--- llvm/test/Transforms/NewGVN/assume-equal-xfail.ll | 107 +++---- llvm/test/Transforms/NewGVN/assume-equal.ll | 10 +- llvm/test/Transforms/NewGVN/basic-cyclic-opt.ll | 157 +++++----- llvm/test/Transforms/NewGVN/basic-undef-test.ll | 12 +- llvm/test/Transforms/NewGVN/big-endian.ll | 44 ++- llvm/test/Transforms/NewGVN/bitcast-of-call.ll | 16 +- llvm/test/Transforms/NewGVN/calloc-load-removal.ll | 11 +- .../test/Transforms/NewGVN/calls-nonlocal-xfail.ll | 14 +- llvm/test/Transforms/NewGVN/calls-readonly.ll | 26 +- llvm/test/Transforms/NewGVN/completeness.ll | 117 ++++--- llvm/test/Transforms/NewGVN/cond_br.ll | 14 +- llvm/test/Transforms/NewGVN/cond_br2-xfail.ll | 100 +++--- llvm/test/Transforms/NewGVN/condprop-xfail.ll | 16 +- llvm/test/Transforms/NewGVN/crash-no-aa.ll | 10 +- llvm/test/Transforms/NewGVN/crash.ll | 89 +++--- llvm/test/Transforms/NewGVN/cyclic-phi-handling.ll | 2 +- llvm/test/Transforms/NewGVN/dbg-redundant-load.ll | 8 +- llvm/test/Transforms/NewGVN/deadstore.ll | 39 ++- llvm/test/Transforms/NewGVN/debugloc-xfail.ll | 6 +- llvm/test/Transforms/NewGVN/edge.ll | 6 +- llvm/test/Transforms/NewGVN/eliminate-ssacopy.ll | 16 +- llvm/test/Transforms/NewGVN/equivalent-phi.ll | 12 +- llvm/test/Transforms/NewGVN/fence-xfail.ll | 26 +- llvm/test/Transforms/NewGVN/flags-simplify.ll | 8 +- llvm/test/Transforms/NewGVN/fold-const-expr.ll | 29 +- llvm/test/Transforms/NewGVN/funclet.ll | 26 +- llvm/test/Transforms/NewGVN/int_sideeffect.ll | 12 +- llvm/test/Transforms/NewGVN/invariant.group.ll | 342 ++++++++++----------- llvm/test/Transforms/NewGVN/invariant.start.ll | 40 +-- llvm/test/Transforms/NewGVN/lifetime-simple.ll | 16 +- llvm/test/Transforms/NewGVN/load-constant-mem.ll | 14 +- .../NewGVN/load-from-unreachable-predecessor.ll | 10 +- llvm/test/Transforms/NewGVN/loadforward.ll | 14 +- llvm/test/Transforms/NewGVN/malloc-load-removal.ll | 36 +-- llvm/test/Transforms/NewGVN/memory-handling.ll | 80 ++--- llvm/test/Transforms/NewGVN/metadata-nonnull.ll | 158 +++++----- llvm/test/Transforms/NewGVN/metadata-simplify.ll | 76 ++--- llvm/test/Transforms/NewGVN/noalias.ll | 32 +- .../Transforms/NewGVN/non-integral-pointers.ll | 16 +- .../Transforms/NewGVN/nonescaping-malloc-xfail.ll | 107 +++---- .../test/Transforms/NewGVN/null-aliases-nothing.ll | 13 +- llvm/test/Transforms/NewGVN/opt-remarks-xfail.ll | 26 +- llvm/test/Transforms/NewGVN/phi-of-ops-loads.ll | 72 ++--- .../Transforms/NewGVN/phi-of-ops-move-block.ll | 8 +- .../phi-of-ops-simplification-dependencies.ll | 26 +- .../NewGVN/phi-translate-partial-alias.ll | 16 +- llvm/test/Transforms/NewGVN/pr10820-xfail.ll | 6 +- llvm/test/Transforms/NewGVN/pr14166-xfail.ll | 22 +- llvm/test/Transforms/NewGVN/pr17732.ll | 10 +- llvm/test/Transforms/NewGVN/pr17852.ll | 54 ++-- llvm/test/Transforms/NewGVN/pr24397.ll | 9 +- llvm/test/Transforms/NewGVN/pr24426.ll | 9 +- llvm/test/Transforms/NewGVN/pr25440.ll | 33 +- llvm/test/Transforms/NewGVN/pr28562.ll | 12 +- llvm/test/Transforms/NewGVN/pr31472.ll | 8 +- llvm/test/Transforms/NewGVN/pr31483.ll | 76 +++-- llvm/test/Transforms/NewGVN/pr31491.ll | 10 +- llvm/test/Transforms/NewGVN/pr31501.ll | 92 +++--- llvm/test/Transforms/NewGVN/pr31573.ll | 14 +- llvm/test/Transforms/NewGVN/pr31594.ll | 42 +-- llvm/test/Transforms/NewGVN/pr31613_2.ll | 8 +- llvm/test/Transforms/NewGVN/pr31682.ll | 22 +- llvm/test/Transforms/NewGVN/pr31758.ll | 16 +- llvm/test/Transforms/NewGVN/pr32607.ll | 6 +- llvm/test/Transforms/NewGVN/pr32836.ll | 20 +- llvm/test/Transforms/NewGVN/pr32838.ll | 22 +- llvm/test/Transforms/NewGVN/pr32845.ll | 22 +- llvm/test/Transforms/NewGVN/pr32852.ll | 6 +- llvm/test/Transforms/NewGVN/pr32897.ll | 12 +- llvm/test/Transforms/NewGVN/pr32934.ll | 36 +-- llvm/test/Transforms/NewGVN/pr32945.ll | 10 +- llvm/test/Transforms/NewGVN/pr32952.ll | 10 +- llvm/test/Transforms/NewGVN/pr33014.ll | 14 +- llvm/test/Transforms/NewGVN/pr33086.ll | 12 +- llvm/test/Transforms/NewGVN/pr33116.ll | 4 +- llvm/test/Transforms/NewGVN/pr33185.ll | 22 +- llvm/test/Transforms/NewGVN/pr33187.ll | 20 +- llvm/test/Transforms/NewGVN/pr33196.ll | 28 +- llvm/test/Transforms/NewGVN/pr33204.ll | 14 +- llvm/test/Transforms/NewGVN/pr33305.ll | 68 ++-- llvm/test/Transforms/NewGVN/pr33367.ll | 108 +++---- llvm/test/Transforms/NewGVN/pr33432.ll | 4 +- llvm/test/Transforms/NewGVN/pr33461.ll | 18 +- llvm/test/Transforms/NewGVN/pr33720.ll | 28 +- llvm/test/Transforms/NewGVN/pr34452.ll | 4 +- llvm/test/Transforms/NewGVN/pr35125.ll | 18 +- .../NewGVN/pr37121-seens-this-value-a-lot.ll | 6 +- llvm/test/Transforms/NewGVN/pre-compare.ll | 12 +- llvm/test/Transforms/NewGVN/pre-new-inst-xfail.ll | 14 +- llvm/test/Transforms/NewGVN/predicates.ll | 18 +- ...preserve-metadata-for-predicate-replacements.ll | 6 +- llvm/test/Transforms/NewGVN/propagate-ir-flags.ll | 6 +- llvm/test/Transforms/NewGVN/range.ll | 80 ++--- llvm/test/Transforms/NewGVN/readattrs.ll | 10 +- .../test/Transforms/NewGVN/rle-must-alias-xfail.ll | 20 +- .../NewGVN/rle-no-phi-translate-xfail.ll | 12 +- llvm/test/Transforms/NewGVN/rle-nonlocal.ll | 22 +- llvm/test/Transforms/NewGVN/rle.ll | 42 ++- llvm/test/Transforms/NewGVN/simp-to-self.ll | 6 +- llvm/test/Transforms/NewGVN/sq-ctxi.ll | 14 +- llvm/test/Transforms/NewGVN/stale-loop-info.ll | 16 +- llvm/test/Transforms/NewGVN/storeoverstore.ll | 24 +- llvm/test/Transforms/NewGVN/tbaa.ll | 96 +++--- llvm/test/Transforms/NewGVN/verify-memoryphi.ll | 8 +- .../test/Transforms/NewGVN/volatile-nonvolatile.ll | 35 +-- 135 files changed, 2163 insertions(+), 2295 deletions(-) diff --git a/llvm/test/Transforms/NewGVN/2007-07-25-DominatedLoop.ll b/llvm/test/Transforms/NewGVN/2007-07-25-DominatedLoop.ll index 22951d7..978f061 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 } -@PL_sv_count = external global i32 ; [#uses=2] +@PL_sv_count = external global i32 ; [#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 ; [#uses=0] + %tmp16092 = load i32, ptr @PL_sv_count, align 4 ; [#uses=0] br label %cond_next165 bb157: ; preds = %cond_next165 - %tmp158 = load i32, i32* @PL_sv_count, align 4 ; [#uses=0] + %tmp158 = load i32, ptr @PL_sv_count, align 4 ; [#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 dd3bd4c..abb6fbe 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 } -@blkshifts = external global %struct.INT2* ; <%struct.INT2**> [#uses=2] +@blkshifts = external global 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 ; [#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 e287538..336f390 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 ; [#uses=0] + %tmp38758 = load i16, ptr null, align 2 ; [#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 312cb22..c46f2b7 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 ; [#uses=1] - %tmp56220 = load i32, i32* %tmp56119 ; [#uses=0] + %tmp56119 = getelementptr %struct.TypHeader, ptr %hdR, i32 0, i32 0 ; [#uses=1] + %tmp56220 = load i32, ptr %tmp56119 ; [#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 ; [#uses=0] + %tmp678 = load i32, ptr %tmp677 ; [#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 ; [#uses=0] + %tmp67812 = load i32, ptr %tmp67711 ; [#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 ; [#uses=1] - %tmp677 = getelementptr %struct.TypHeader, %struct.TypHeader* %hdR, i32 0, i32 0 ; [#uses=1] + %tmp67711 = getelementptr %struct.TypHeader, ptr %hdR, i32 0, i32 0 ; [#uses=1] + %tmp677 = getelementptr %struct.TypHeader, ptr %hdR, i32 0, i32 0 ; [#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 b1c476b..0b0597f 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 ; [#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 ; [#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 ; [#uses=1] - %tmp46 = load double, double* %tmp3.i8 ; [#uses=0] + %tmp3.i8 = getelementptr %struct.mrViewingHitRecord, ptr %VHR, i32 0, i32 1, i32 0, i32 0 ; [#uses=1] + %tmp46 = load double, ptr %tmp3.i8 ; [#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 5a4ae79..8d3bfcd 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 -@bsLive = external global i32 ; [#uses=2] +@bsLive = external global i32 ; [#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 ; [#uses=0] + %tmp29 = load i32, ptr @bsLive, align 4 ; [#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 532402e..22d6432 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] } -@n_spills = external global i32 ; [#uses=2] +@n_spills = external global i32 ; [#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 ; [#uses=0] + %tmp2922 = load i32, ptr @n_spills, align 4 ; [#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 ; [#uses=0] + %tmp298316 = load i32, ptr @n_spills, align 4 ; [#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 389ab5f..59da31c 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 ; [#uses=1] - ret i8* %retval980 + %retval980 = load ptr, ptr null ; [#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 d4d65b0..f72fcbc 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* } -@debug = external constant i32 ; [#uses=0] -@counters = external constant i32 ; [#uses=1] -@trialx = external global [17 x i32] ; <[17 x i32]*> [#uses=1] -@dummy1 = external global [7 x i32] ; <[7 x i32]*> [#uses=0] -@dummy2 = external global [4 x i32] ; <[4 x i32]*> [#uses=0] -@unacceptable = external global i32 ; [#uses=0] -@isa = external global [13 x %struct.anon] ; <[13 x %struct.anon]*> [#uses=3] -@.str = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str1 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0] -@.str2 = external constant [1 x i8] ; <[1 x i8]*> [#uses=0] -@.str3 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str4 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0] -@.str5 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str6 = external constant [2 x i8] ; <[2 x i8]*> [#uses=0] -@.str7 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str8 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str9 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str10 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str11 = external constant [2 x i8] ; <[2 x i8]*> [#uses=0] -@.str12 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str13 = external constant [2 x i8] ; <[2 x i8]*> [#uses=0] -@.str14 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0] -@.str15 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0] -@.str16 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str17 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str18 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0] -@.str19 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str20 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str21 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str22 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str23 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0] -@.str24 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str25 = external constant [6 x i8] ; <[6 x i8]*> [#uses=0] -@.str26 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0] -@.str27 = external constant [6 x i8] ; <[6 x i8]*> [#uses=0] -@r = external global [17 x i32] ; <[17 x i32]*> [#uses=0] -@.str28 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0] -@.str29 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0] -@pgm = external global [5 x { i32, [3 x i32] }] ; <[5 x { i32, [3 x i32] }]*> [#uses=4] -@.str30 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0] -@.str31 = external constant [13 x i8] ; <[13 x i8]*> [#uses=0] -@.str32 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0] -@.str33 = external constant [4 x i8] ; <[4 x i8]*> [#uses=0] -@.str34 = external constant [20 x i8] ; <[20 x i8]*> [#uses=0] -@numi = external global i32 ; [#uses=7] -@.str35 = external constant [10 x i8] ; <[10 x i8]*> [#uses=0] -@counter = external global [5 x i32] ; <[5 x i32]*> [#uses=2] -@itrialx.2510 = external global i32 ; [#uses=0] -@.str36 = external constant [43 x i8] ; <[43 x i8]*> [#uses=0] -@.str37 = external constant [42 x i8] ; <[42 x i8]*> [#uses=0] -@corr_result = external global i32 ; [#uses=0] -@.str38 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0] -@.str39 = external constant [5 x i8] ; <[5 x i8]*> [#uses=0] -@.str40 = external constant [47 x i8] ; <[47 x i8]*> [#uses=0] -@correct_result = external global [17 x i32] ; <[17 x i32]*> [#uses=1] -@.str41 = external constant [46 x i8] ; <[46 x i8]*> [#uses=0] -@.str42 = external constant [32 x i8] ; <[32 x i8]*> [#uses=0] -@.str43 = external constant [44 x i8] ; <[44 x i8]*> [#uses=1] -@.str44 = external constant [21 x i8] ; <[21 x i8]*> [#uses=1] -@.str45 = external constant [12 x i8] ; <[12 x i8]*> [#uses=1] -@.str46 = external constant [5 x i8] ; <[5 x i8]*> [#uses=1] -@.str47 = external constant [12 x i8] ; <[12 x i8]*> [#uses=1] + %struct.anon = type { ptr, i32, i32, [3 x i32], ptr, ptr, ptr } +@debug = external constant i32 ; [#uses=0] +@counters = external constant i32 ; [#uses=1] +@trialx = external global [17 x i32] ; [#uses=1] +@dummy1 = external global [7 x i32] ; [#uses=0] +@dummy2 = external global [4 x i32] ; [#uses=0] +@unacceptable = external global i32 ; [#uses=0] +@isa = external global [13 x %struct.anon] ; [#uses=3] +@.str = external constant [4 x i8] ; [#uses=0] +@.str1 = external constant [3 x i8] ; [#uses=0] +@.str2 = external constant [1 x i8] ; [#uses=0] +@.str3 = external constant [4 x i8] ; [#uses=0] +@.str4 = external constant [3 x i8] ; [#uses=0] +@.str5 = external constant [4 x i8] ; [#uses=0] +@.str6 = external constant [2 x i8] ; [#uses=0] +@.str7 = external constant [4 x i8] ; [#uses=0] +@.str8 = external constant [4 x i8] ; [#uses=0] +@.str9 = external constant [4 x i8] ; [#uses=0] +@.str10 = external constant [4 x i8] ; [#uses=0] +@.str11 = external constant [2 x i8] ; [#uses=0] +@.str12 = external constant [4 x i8] ; [#uses=0] +@.str13 = external constant [2 x i8] ; [#uses=0] +@.str14 = external constant [5 x i8] ; [#uses=0] +@.str15 = external constant [5 x i8] ; [#uses=0] +@.str16 = external constant [4 x i8] ; [#uses=0] +@.str17 = external constant [4 x i8] ; [#uses=0] +@.str18 = external constant [3 x i8] ; [#uses=0] +@.str19 = external constant [4 x i8] ; [#uses=0] +@.str20 = external constant [4 x i8] ; [#uses=0] +@.str21 = external constant [4 x i8] ; [#uses=0] +@.str22 = external constant [4 x i8] ; [#uses=0] +@.str23 = external constant [5 x i8] ; [#uses=0] +@.str24 = external constant [4 x i8] ; [#uses=0] +@.str25 = external constant [6 x i8] ; [#uses=0] +@.str26 = external constant [5 x i8] ; [#uses=0] +@.str27 = external constant [6 x i8] ; [#uses=0] +@r = external global [17 x i32] ; [#uses=0] +@.str28 = external constant [3 x i8] ; [#uses=0] +@.str29 = external constant [5 x i8] ; [#uses=0] +@pgm = external global [5 x { i32, [3 x i32] }] ; [#uses=4] +@.str30 = external constant [3 x i8] ; [#uses=0] +@.str31 = external constant [13 x i8] ; [#uses=0] +@.str32 = external constant [3 x i8] ; [#uses=0] +@.str33 = external constant [4 x i8] ; [#uses=0] +@.str34 = external constant [20 x i8] ; [#uses=0] +@numi = external global i32 ; [#uses=7] +@.str35 = external constant [10 x i8] ; [#uses=0] +@counter = external global [5 x i32] ; [#uses=2] +@itrialx.2510 = external global i32 ; [#uses=0] +@.str36 = external constant [43 x i8] ; [#uses=0] +@.str37 = external constant [42 x i8] ; [#uses=0] +@corr_result = external global i32 ; [#uses=0] +@.str38 = external constant [3 x i8] ; [#uses=0] +@.str39 = external constant [5 x i8] ; [#uses=0] +@.str40 = external constant [47 x i8] ; [#uses=0] +@correct_result = external global [17 x i32] ; [#uses=1] +@.str41 = external constant [46 x i8] ; [#uses=0] +@.str42 = external constant [32 x i8] ; [#uses=0] +@.str43 = external constant [44 x i8] ; [#uses=1] +@.str44 = external constant [21 x i8] ; [#uses=1] +@.str45 = external constant [12 x i8] ; [#uses=1] +@.str46 = external constant [5 x i8] ; [#uses=1] +@.str47 = external constant [12 x i8] ; [#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 ; [#uses=1] - %argv_addr = alloca i8** ; [#uses=1] - %retval = alloca i32, align 4 ; [#uses=2] - %tmp = alloca i32, align 4 ; [#uses=2] - %i = alloca i32, align 4 ; [#uses=21] - %num_sol = alloca i32, align 4 ; [#uses=4] - %total = alloca i32, align 4 ; [#uses=4] + %argc_addr = alloca i32 ; [#uses=1] + %argv_addr = alloca ptr ; [#uses=1] + %retval = alloca i32, align 4 ; [#uses=2] + %tmp = alloca i32, align 4 ; [#uses=2] + %i = alloca i32, align 4 ; [#uses=21] + %num_sol = alloca i32, align 4 ; [#uses=4] + %total = alloca i32, align 4 ; [#uses=4] %"alloca point" = bitcast i32 0 to 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 ; [#uses=1] - %tmp2 = getelementptr [44 x i8], [44 x i8]* @.str43, i32 0, i32 0 ; [#uses=1] - %tmp3 = call i32 (i8*, ...) @printf( i8* %tmp2, i32 %tmp1 ) ; [#uses=0] - store i32 0, i32* %i + %tmp1 = load i32, ptr @numi ; [#uses=1] + %tmp2 = getelementptr [44 x i8], ptr @.str43, i32 0, i32 0 ; [#uses=1] + %tmp3 = call i32 (ptr, ...) @printf( ptr %tmp2, i32 %tmp1 ) ; [#uses=0] + store i32 0, ptr %i br label %bb13 bb4: ; preds = %bb13 - %tmp5 = load i32, i32* %i ; [#uses=1] - %tmp6 = load i32, i32* %i ; [#uses=1] - %tmp7 = getelementptr [17 x i32], [17 x i32]* @trialx, i32 0, i32 %tmp6 ; [#uses=1] - %tmp8 = load i32, i32* %tmp7 ; [#uses=1] + %tmp5 = load i32, ptr %i ; [#uses=1] + %tmp6 = load i32, ptr %i ; [#uses=1] + %tmp7 = getelementptr [17 x i32], ptr @trialx, i32 0, i32 %tmp6 ; [#uses=1] + %tmp8 = load i32, ptr %tmp7 ; [#uses=1] %tmp9 = call i32 @userfun( i32 %tmp8 ) ; [#uses=1] - %tmp10 = getelementptr [17 x i32], [17 x i32]* @correct_result, i32 0, i32 %tmp5 ; [#uses=1] - store i32 %tmp9, i32* %tmp10 - %tmp11 = load i32, i32* %i ; [#uses=1] + %tmp10 = getelementptr [17 x i32], ptr @correct_result, i32 0, i32 %tmp5 ; [#uses=1] + store i32 %tmp9, ptr %tmp10 + %tmp11 = load i32, ptr %i ; [#uses=1] %tmp12 = add i32 %tmp11, 1 ; [#uses=1] - store i32 %tmp12, i32* %i + store i32 %tmp12, ptr %i br label %bb13 bb13: ; preds = %bb4, %bb - %tmp14 = load i32, i32* %i ; [#uses=1] + %tmp14 = load i32, ptr %i ; [#uses=1] %tmp15 = icmp sle i32 %tmp14, 16 ; [#uses=1] %tmp1516 = zext i1 %tmp15 to i32 ; [#uses=1] %toBool = icmp ne i32 %tmp1516, 0 ; [#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 ; [#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 ; [#uses=1] - store i32 0, i32* %tmp21 - %tmp22 = load i32, i32* %i ; [#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 ; [#uses=1] - %tmp26 = load i32, i32* %tmp25 ; [#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 ; [#uses=1] - store i32 %tmp26, i32* %tmp29 - %tmp30 = load i32, i32* %i ; [#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 ; [#uses=1] - %tmp34 = load i32, i32* %tmp33 ; [#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 ; [#uses=1] - store i32 %tmp34, i32* %tmp37 - %tmp38 = load i32, i32* %i ; [#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 ; [#uses=1] - %tmp42 = load i32, i32* %tmp41 ; [#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 ; [#uses=1] - store i32 %tmp42, i32* %tmp45 - %tmp46 = load i32, i32* %i ; [#uses=1] + %tmp19 = load i32, ptr %i ; [#uses=1] + %tmp20 = getelementptr [5 x { i32, [3 x i32] }], ptr @pgm, i32 0, i32 %tmp19 ; [#uses=1] + %tmp21 = getelementptr { i32, [3 x i32] }, ptr %tmp20, i32 0, i32 0 ; [#uses=1] + store i32 0, ptr %tmp21 + %tmp22 = load i32, ptr %i ; [#uses=1] + %tmp23 = getelementptr [13 x %struct.anon], ptr @isa, i32 0, i32 0 ; [#uses=1] + %tmp24 = getelementptr %struct.anon, ptr %tmp23, i32 0, i32 3 ; [#uses=1] + %tmp25 = getelementptr [3 x i32], ptr %tmp24, i32 0, i32 0 ; [#uses=1] + %tmp26 = load i32, ptr %tmp25 ; [#uses=1] + %tmp27 = getelementptr [5 x { i32, [3 x i32] }], ptr @pgm, i32 0, i32 %tmp22 ; [#uses=1] + %tmp28 = getelementptr { i32, [3 x i32] }, ptr %tmp27, i32 0, i32 1 ; [#uses=1] + %tmp29 = getelementptr [3 x i32], ptr %tmp28, i32 0, i32 0 ; [#uses=1] + store i32 %tmp26, ptr %tmp29 + %tmp30 = load i32, ptr %i ; [#uses=1] + %tmp31 = getelementptr [13 x %struct.anon], ptr @isa, i32 0, i32 0 ; [#uses=1] + %tmp32 = getelementptr %struct.anon, ptr %tmp31, i32 0, i32 3 ; [#uses=1] + %tmp33 = getelementptr [3 x i32], ptr %tmp32, i32 0, i32 1 ; [#uses=1] + %tmp34 = load i32, ptr %tmp33 ; [#uses=1] + %tmp35 = getelementptr [5 x { i32, [3 x i32] }], ptr @pgm, i32 0, i32 %tmp30 ; [#uses=1] + %tmp36 = getelementptr { i32, [3 x i32] }, ptr %tmp35, i32 0, i32 1 ; [#uses=1] + %tmp37 = getelementptr [3 x i32], ptr %tmp36, i32 0, i32 1 ; [#uses=1] + store i32 %tmp34, ptr %tmp37 + %tmp38 = load i32, ptr %i ; [#uses=1] + %tmp39 = getelementptr [13 x %struct.anon], ptr @isa, i32 0, i32 0 ; [#uses=1] + %tmp40 = getelementptr %struct.anon, ptr %tmp39, i32 0, i32 3 ; [#uses=1] + %tmp41 = getelementptr [3 x i32], ptr %tmp40, i32 0, i32 2 ; [#uses=1] + %tmp42 = load i32, ptr %tmp41 ; [#uses=1] + %tmp43 = getelementptr [5 x { i32, [3 x i32] }], ptr @pgm, i32 0, i32 %tmp38 ; [#uses=1] + %tmp44 = getelementptr { i32, [3 x i32] }, ptr %tmp43, i32 0, i32 1 ; [#uses=1] + %tmp45 = getelementptr [3 x i32], ptr %tmp44, i32 0, i32 2 ; [#uses=1] + store i32 %tmp42, ptr %tmp45 + %tmp46 = load i32, ptr %i ; [#uses=1] call void @fix_operands( i32 %tmp46 ) - %tmp47 = load i32, i32* %i ; [#uses=1] + %tmp47 = load i32, ptr %i ; [#uses=1] ; CHECK: %tmp47 = phi i32 [ %tmp48, %bb18 ], [ 0, %bb17 ] %tmp48 = add i32 %tmp47, 1 ; [#uses=1] - store i32 %tmp48, i32* %i + store i32 %tmp48, ptr %i br label %bb49 bb49: ; preds = %bb18, %bb17 - %tmp50 = load i32, i32* @numi ; [#uses=1] - %tmp51 = load i32, i32* %i ; [#uses=1] + %tmp50 = load i32, ptr @numi ; [#uses=1] + %tmp51 = load i32, ptr %i ; [#uses=1] %tmp52 = icmp slt i32 %tmp51, %tmp50 ; [#uses=1] %tmp5253 = zext i1 %tmp52 to i32 ; [#uses=1] %toBool54 = icmp ne i32 %tmp5253, 0 ; [#uses=1] @@ -230,62 +230,62 @@ bb49: ; preds = %bb18, %bb17 bb55: ; preds = %bb49 %tmp56 = call i32 @search( ) ; [#uses=1] - store i32 %tmp56, i32* %num_sol - %tmp57 = getelementptr [21 x i8], [21 x i8]* @.str44, i32 0, i32 0 ; [#uses=1] - %tmp58 = load i32, i32* %num_sol ; [#uses=1] - %tmp59 = call i32 (i8*, ...) @printf( i8* %tmp57, i32 %tmp58 ) ; [#uses=0] - %tmp60 = load i32, i32* @counters ; [#uses=1] + store i32 %tmp56, ptr %num_sol + %tmp57 = getelementptr [21 x i8], ptr @.str44, i32 0, i32 0 ; [#uses=1] + %tmp58 = load i32, ptr %num_sol ; [#uses=1] + %tmp59 = call i32 (ptr, ...) @printf( ptr %tmp57, i32 %tmp58 ) ; [#uses=0] + %tmp60 = load i32, ptr @counters ; [#uses=1] %tmp61 = icmp ne i32 %tmp60, 0 ; [#uses=1] %tmp6162 = zext i1 %tmp61 to i32 ; [#uses=1] %toBool63 = icmp ne i32 %tmp6162, 0 ; [#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 ; [#uses=1] - %tmp65 = call i32 (i8*, ...) @printf( i8* %tmp64 ) ; [#uses=0] - store i32 0, i32* %i + store i32 0, ptr %total + %tmp64 = getelementptr [12 x i8], ptr @.str45, i32 0, i32 0 ; [#uses=1] + %tmp65 = call i32 (ptr, ...) @printf( ptr %tmp64 ) ; [#uses=0] + store i32 0, ptr %i br label %bb79 bb66: ; preds = %bb79 - %tmp67 = load i32, i32* %i ; [#uses=1] - %tmp68 = getelementptr [5 x i32], [5 x i32]* @counter, i32 0, i32 %tmp67 ; [#uses=1] - %tmp69 = load i32, i32* %tmp68 ; [#uses=1] - %tmp70 = getelementptr [5 x i8], [5 x i8]* @.str46, i32 0, i32 0 ; [#uses=1] - %tmp71 = call i32 (i8*, ...) @printf( i8* %tmp70, i32 %tmp69 ) ; [#uses=0] - %tmp72 = load i32, i32* %i ; [#uses=1] - %tmp73 = getelementptr [5 x i32], [5 x i32]* @counter, i32 0, i32 %tmp72 ; [#uses=1] - %tmp74 = load i32, i32* %tmp73 ; [#uses=1] - %tmp75 = load i32, i32* %total ; [#uses=1] + %tmp67 = load i32, ptr %i ; [#uses=1] + %tmp68 = getelementptr [5 x i32], ptr @counter, i32 0, i32 %tmp67 ; [#uses=1] + %tmp69 = load i32, ptr %tmp68 ; [#uses=1] + %tmp70 = getelementptr [5 x i8], ptr @.str46, i32 0, i32 0 ; [#uses=1] + %tmp71 = call i32 (ptr, ...) @printf( ptr %tmp70, i32 %tmp69 ) ; [#uses=0] + %tmp72 = load i32, ptr %i ; [#uses=1] + %tmp73 = getelementptr [5 x i32], ptr @counter, i32 0, i32 %tmp72 ; [#uses=1] + %tmp74 = load i32, ptr %tmp73 ; [#uses=1] + %tmp75 = load i32, ptr %total ; [#uses=1] %tmp76 = add i32 %tmp74, %tmp75 ; [#uses=1] - store i32 %tmp76, i32* %total - %tmp77 = load i32, i32* %i ; [#uses=1] + store i32 %tmp76, ptr %total + %tmp77 = load i32, ptr %i ; [#uses=1] %tmp78 = add i32 %tmp77, 1 ; [#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 ; [#uses=1] - %tmp81 = load i32, i32* %i ; [#uses=1] + %tmp80 = load i32, ptr @numi ; [#uses=1] + %tmp81 = load i32, ptr %i ; [#uses=1] %tmp82 = icmp slt i32 %tmp81, %tmp80 ; [#uses=1] %tmp8283 = zext i1 %tmp82 to i32 ; [#uses=1] %toBool84 = icmp ne i32 %tmp8283, 0 ; [#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 ; [#uses=1] - %tmp87 = load i32, i32* %total ; [#uses=1] - %tmp88 = call i32 (i8*, ...) @printf( i8* %tmp86, i32 %tmp87 ) ; [#uses=0] + %tmp86 = getelementptr [12 x i8], ptr @.str47, i32 0, i32 0 ; [#uses=1] + %tmp87 = load i32, ptr %total ; [#uses=1] + %tmp88 = call i32 (ptr, ...) @printf( ptr %tmp86, i32 %tmp87 ) ; [#uses=0] br label %cond_next cond_next: ; preds = %bb85, %bb55 - %tmp89 = load i32, i32* @numi ; [#uses=1] + %tmp89 = load i32, ptr @numi ; [#uses=1] %tmp90 = add i32 %tmp89, 1 ; [#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 ; [#uses=1] + %tmp92 = load i32, ptr @numi ; [#uses=1] %tmp93 = icmp sgt i32 %tmp92, 5 ; [#uses=1] %tmp9394 = zext i1 %tmp93 to i32 ; [#uses=1] %toBool95 = icmp ne i32 %tmp9394, 0 ; [#uses=1] @@ -295,20 +295,20 @@ cond_true96: ; preds = %bb91 br label %bb102 cond_next97: ; preds = %bb91 - %tmp98 = load i32, i32* %num_sol ; [#uses=1] + %tmp98 = load i32, ptr %num_sol ; [#uses=1] %tmp99 = icmp eq i32 %tmp98, 0 ; [#uses=1] %tmp99100 = zext i1 %tmp99 to i32 ; [#uses=1] %toBool101 = icmp ne i32 %tmp99100, 0 ; [#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 ; [#uses=1] - store i32 %tmp103, i32* %retval + store i32 0, ptr %tmp + %tmp103 = load i32, ptr %tmp ; [#uses=1] + store i32 %tmp103, ptr %retval br label %return return: ; preds = %bb102 - %retval104 = load i32, i32* %retval ; [#uses=1] + %retval104 = load i32, ptr %retval ; [#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 a7d807f..934fffc 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 -@img_width = external global i16 ; [#uses=2] +@img_width = external global i16 ; [#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 ; [#uses=0] + %tmp701 = load i16, ptr @img_width, align 2 ; [#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 e646c51..3b02b47 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 ; [#uses=1] - %tmp1 = getelementptr i32, i32* %tmp, i32 1 ; [#uses=2] - %tmp2 = load i32, i32* %tmp1, align 4 ; [#uses=1] + %c = alloca %struct.anon ; [#uses=2] + %tmp = getelementptr %struct.anon, ptr %c, i32 0, i32 0 ; [#uses=1] + %tmp1 = getelementptr i32, ptr %tmp, i32 1 ; [#uses=2] + %tmp2 = load i32, ptr %tmp1, align 4 ; [#uses=1] ; CHECK-NOT: load %tmp3 = or i32 %tmp2, 11 ; [#uses=1] %tmp4 = and i32 %tmp3, -21 ; [#uses=1] - store i32 %tmp4, i32* %tmp1, align 4 - %call = call i32 (...) @x( %struct.anon* %c ) ; [#uses=0] + store i32 %tmp4, ptr %tmp1, align 4 + %call = call i32 (...) @x( ptr %c ) ; [#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 fc99f8f..b2440fb 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* ; [#uses=3] - store float* %sx, float** %sx_addr, align 4 + %sx_addr = alloca 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 ; [#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 ; [#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 ; [#uses=1] + %retval59 = load i32, ptr null, align 4 ; [#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 d737162..0c1891e 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 -@g_3 = external global i8 ; [#uses=2] +@g_3 = external global i8 ; [#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 ; [#uses=0] - store i8 %tmp3, i8* %A + %tmp3 = load i8, ptr @g_3 ; [#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 ; [#uses=0] + %tmp10 = load i8, ptr @g_3 ; [#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 4a55ef6..a2e252d 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 ; [#uses=1] + %0 = getelementptr %struct.d_print_info, ptr %dpi, i32 0, i32 1 ; [#uses=1] br i1 false, label %return, label %bb bb: ; preds = %entry - %1 = load i8*, i8** %0, align 4 ; [#uses=0] - %2 = getelementptr %struct.d_print_info, %struct.d_print_info* %dpi, i32 0, i32 1 ; [#uses=0] + %1 = load ptr, ptr %0, align 4 ; [#uses=0] + %2 = getelementptr %struct.d_print_info, ptr %dpi, i32 0, i32 1 ; [#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 dfe82fd..bb51f72 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 ; [#uses=0] - %tmp1 = getelementptr i8, i8* %opt.0, i32 1 ; [#uses=2] + %tmp = load i8, ptr %opt.0, align 1 ; [#uses=0] + %tmp1 = getelementptr i8, ptr %opt.0, i32 1 ; [#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 ] ; [#uses=3] - %tmp2 = load i8, i8* %opt.0, align 1 ; [#uses=0] + %opt.0 = phi ptr [ %tmp3, %bb84 ], [ %tmp1, %bb79 ], [ %tmp1, %bb41 ] ; [#uses=3] + %tmp2 = load i8, ptr %opt.0, align 1 ; [#uses=0] br i1 false, label %bb84, label %bb41 bb84: ; preds = %bb82, %entry - %tmp3 = getelementptr i8, i8* null, i32 1 ; [#uses=1] + %tmp3 = getelementptr i8, ptr null, i32 1 ; [#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 5973b54..38d1240 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" -@sort_value = external global [256 x i32], align 32 ; <[256 x i32]*> [#uses=2] +@sort_value = external global [256 x i32], align 32 ; [#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 ] ; [#uses=1] - %0 = load i32, i32* %sortv.233, align 4 ; [#uses=0] - %sortv.2 = getelementptr [256 x i32], [256 x i32]* @sort_value, i32 0, i32 0 ; [#uses=1] + %sortv.233 = phi ptr [ @sort_value, %bb22 ], [ %sortv.2, %bb23 ] ; [#uses=1] + %0 = load i32, ptr %sortv.233, align 4 ; [#uses=0] + %sortv.2 = getelementptr [256 x i32], ptr @sort_value, i32 0, i32 0 ; [#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 dd4af61..0b1761d 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 ; [#uses=1] - %tmp1 = load i32, i32* %tmp, align 4 ; [#uses=0] + %tmp = getelementptr i32, ptr %decl, i32 1 ; [#uses=1] + %tmp1 = load i32, ptr %tmp, align 4 ; [#uses=0] br i1 false, label %bb207, label %bb204 bb204: ; preds = %bb203 - %tmp2 = getelementptr i32, i32* %decl, i32 1 ; [#uses=1] + %tmp2 = getelementptr i32, ptr %decl, i32 1 ; [#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 ] ; [#uses=1] - %iftmp.1374.0 = load i32, i32* %iftmp.1374.0.in ; [#uses=0] + %iftmp.1374.0.in = phi ptr [ null, %bb207 ], [ %tmp2, %bb204 ] ; [#uses=1] + %iftmp.1374.0 = load i32, ptr %iftmp.1374.0.in ; [#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 e61c161..8631cbd 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 ] ; [#uses=5] + %d.0 = phi ptr [ null, %entry ], [ %d.0, %bb159 ], [ %d.0, %bb554 ], [ %d.0, %bb159 ], [ %d.0, %bb159 ], [ %d.12, %bb664 ] ; [#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 ; [#uses=0] + %0 = load i8, ptr %d.0, align 8 ; [#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 ; [#uses=1] + %d.12 = select i1 false, ptr null, ptr null ; [#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 7234344..d8871700d 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 ; [#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 ; [#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 ; [#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 ; [#uses=1] + %4 = getelementptr %struct.IdList, ptr %pColumn, i32 0, i32 0 ; [#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 a470e08..6aa79e0 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" = type <{ i8 }> + %"struct.__gnu_cxx::hash" = 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 > >,std::_Select1st > > >,std::less,std::allocator > > > >" = type { %"struct.std::_Rb_tree > >,std::_Select1st > > >,std::less,std::allocator > > > >::_Rb_tree_impl,false>" } - %"struct.std::_Rb_tree > >,std::_Select1st > > >,std::less,std::allocator > > > >::_Rb_tree_impl,false>" = type { %"struct.__gnu_cxx::hash", %"struct.std::_Rb_tree_node_base", i32 } - %"struct.std::_Rb_tree_iterator > > >" = 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 > > >,bool>" = type { %"struct.std::_Rb_tree_iterator > > >", i8 } - %"struct.std::pair" = type { i8*, i8* } - -@_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*), i32 (i32*, void ()*)* @pthread_once ; [#uses=0] -@_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32), i8* (i32)* @pthread_getspecific ; [#uses=0] -@_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*), i32 (i32, i8*)* @pthread_setspecific ; [#uses=0] -@_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 ; [#uses=0] -@_ZL22__gthrw_pthread_cancelm = weak alias i32 (i32), i32 (i32)* @pthread_cancel ; [#uses=0] -@_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*), i32 (%struct.pthread_mutex_t*)* @pthread_mutex_lock ; [#uses=0] -@_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*), i32 (%struct.pthread_mutex_t*)* @pthread_mutex_trylock ; [#uses=0] -@_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%struct.pthread_mutex_t*), i32 (%struct.pthread_mutex_t*)* @pthread_mutex_unlock ; [#uses=0] -@_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 ; [#uses=0] -@_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*), i32 (i32*, void (i8*)*)* @pthread_key_create ; [#uses=0] -@_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32), i32 (i32)* @pthread_key_delete ; [#uses=0] -@_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%struct.__sched_param*), i32 (%struct.__sched_param*)* @pthread_mutexattr_init ; [#uses=0] -@_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%struct.__sched_param*, i32), i32 (%struct.__sched_param*, i32)* @pthread_mutexattr_settype ; [#uses=0] -@_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%struct.__sched_param*), i32 (%struct.__sched_param*)* @pthread_mutexattr_destroy ; [#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 > >,std::_Select1st > > >,std::less,std::allocator > > > >" = type { %"struct.std::_Rb_tree > >,std::_Select1st > > >,std::less,std::allocator > > > >::_Rb_tree_impl,false>" } + %"struct.std::_Rb_tree > >,std::_Select1st > > >,std::less,std::allocator > > > >::_Rb_tree_impl,false>" = type { %"struct.__gnu_cxx::hash", %"struct.std::_Rb_tree_node_base", i32 } + %"struct.std::_Rb_tree_iterator > > >" = type { ptr } + %"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr } + %"struct.std::pair > > >,bool>" = type { %"struct.std::_Rb_tree_iterator > > >", i8 } + %"struct.std::pair" = type { ptr, ptr } + +@_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (ptr, ptr), ptr @pthread_once ; [#uses=0] +@_ZL27__gthrw_pthread_getspecificj = weak alias ptr (i32), ptr @pthread_getspecific ; [#uses=0] +@_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, ptr), ptr @pthread_setspecific ; [#uses=0] +@_ZL22__gthrw_pthread_createPmPK16__pthread_attr_sPFPvS3_ES3_ = weak alias i32 (ptr, ptr, ptr, ptr), ptr @pthread_create ; [#uses=0] +@_ZL22__gthrw_pthread_cancelm = weak alias i32 (i32), ptr @pthread_cancel ; [#uses=0] +@_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (ptr), ptr @pthread_mutex_lock ; [#uses=0] +@_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (ptr), ptr @pthread_mutex_trylock ; [#uses=0] +@_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (ptr), ptr @pthread_mutex_unlock ; [#uses=0] +@_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (ptr, ptr), ptr @pthread_mutex_init ; [#uses=0] +@_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (ptr, ptr), ptr @pthread_key_create ; [#uses=0] +@_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32), ptr @pthread_key_delete ; [#uses=0] +@_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (ptr), ptr @pthread_mutexattr_init ; [#uses=0] +@_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (ptr, i32), ptr @pthread_mutexattr_settype ; [#uses=0] +@_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (ptr), ptr @pthread_mutexattr_destroy ; [#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 > > >,bool>"* noalias nocapture sret(%"struct.std::pair > > >,bool>") %agg.result, %"struct.std::_Rb_tree > >,std::_Select1st > > >,std::less,std::allocator > > > >"* %this, %"struct.std::pair"* %__v) nounwind { +define fastcc void @_ZNSt8_Rb_treeIPvSt4pairIKS0_S0_ESt10_Select1stIS3_ESt4lessIS0_ESaIS3_EE16_M_insert_uniqueERKS3_(ptr noalias nocapture sret(%"struct.std::pair > > >,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 1fc324c..24ad185 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 ; [#uses=0] + %0 = load i8, ptr %sp.1, align 1 ; [#uses=0] br label %bb62 bb51: ; preds = %bb - %1 = load i8, i8* %sp.1, align 1 ; [#uses=0] - ret i8* null + %1 = load i8, ptr %sp.1, align 1 ; [#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 ] ; [#uses=3] + %sp.1 = phi ptr [ null, %bb62 ], [ %sp.1.lcssa, %bb84 ], [ %start, %entry ], [ %sp.1.lcssa, %bb69 ] ; [#uses=3] br i1 false, label %bb, label %bb65 bb65: ; preds = %bb63 - %sp.1.lcssa = phi i8* [ %sp.1, %bb63 ] ; [#uses=4] + %sp.1.lcssa = phi ptr [ %sp.1, %bb63 ] ; [#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 ; [#uses=0] + %2 = tail call ptr @lbackref(ptr %m, ptr %sp.1.lcssa, ptr %stop, i32 0, i32 %stopst, i32 0, i32 0) nounwind ; [#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 ] ; [#uses=0] + %sp.1.lcssa.lcssa33 = phi ptr [ %sp.1.lcssa, %bb69 ] ; [#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 2ccd168..3eda7ca 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))) ; [#uses=2] - store i8 42, i8* %1 - %X = bitcast i8* %1 to i64* ; [#uses=1] - %Y = load i64, i64* %X ; [#uses=1] + %1 = tail call ptr @malloc(i64 mul (i64 4, i64 ptrtoint (ptr getelementptr (i64, ptr null, i64 1) to i64))) ; [#uses=2] + store i8 42, ptr %1 + %Y = load i64, ptr %1 ; [#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 7664b9e..321f3cf 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 ; [#uses=0] - %1 = load i8*, i8** undef, align 4 ; [#uses=0] + %0 = load ptr, ptr undef, align 4 ; [#uses=0] + %1 = load ptr, ptr undef, align 4 ; [#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 b363685..0d2d45a 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 ; [#uses=1] - %1 = bitcast i8* %0 to i32* ; [#uses=1] - store i32 undef, i32* %1, align 1 + %0 = getelementptr inbounds i8, ptr undef, i64 5 ; [#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 ; [#uses=1] - %3 = bitcast i8* %2 to i1* ; [#uses=1] - %4 = load i1, i1* %3 ; [#uses=1] - br i1 %4, label %k151.i.i, label %l147.i.i + %1 = getelementptr i8, ptr undef, i64 5 ; [#uses=1] + %2 = load i1, ptr %1 ; [#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 57a7bd02..3e8a5d8 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 %".i" ".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 %".i" ".i": @@ -50,7 +50,7 @@ doemit.exit76.i: ".i": %wascaret_2.i = phi i32 [ 0, %".i" ], [ 0, %".i" ], [ 0, %".i" ], [ 0, %".i" ], [ 0, %".i" ], [ 0, %".i" ], [ 0, %doemit.exit76.i ], [ 1, %doemit.exit51.i ], [ 0, %".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 %".i", label %"" ".i": diff --git a/llvm/test/Transforms/NewGVN/2011-09-07-TypeIdFor.ll b/llvm/test/Transforms/NewGVN/2011-09-07-TypeIdFor.ll index 771449a..46e3c28 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 2290312..2fb275d 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> , <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> , <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> , <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> , <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> ); + call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> %in1.v, <2 x ptr> %tmp, i32 1, <2 x i1> ); ; 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> , <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> , <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> ); + call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> %in2.v, <2 x ptr> %tmp, i32 1, <2 x i1> ); ; 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> , <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> , <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 1818d7f..47db666 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> , <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> , <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> , <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> , <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> ); + call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> %in1.v, <2 x ptr> %tmp, i32 1, <2 x i1> ); ; 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> , <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> , <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> ); + call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> %in2.v, <2 x ptr> %tmp, i32 1, <2 x i1> ); ; 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> , <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> , <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 8dbd82a..f2d1827 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 6b96c84..fea8a2f 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 different result ; address spaces aren't incorrectly merged. -define i32 addrspace(1)* @addrspacecast_different_result_types(i32* %ptr) { +define ptr addrspace(1) @addrspacecast_different_result_types(ptr %ptr) { ; CHECK-LABEL: @addrspacecast_different_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 } -@h = common local_unnamed_addr global i32* null, align 4 +@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 a156ac4..972a9bc 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 (...)** } -@_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 -@_ZTI1A = external constant i8* +%struct.A = type { ptr } +@_ZTV1A = available_externally unnamed_addr constant [4 x ptr] [ptr null, ptr @_ZTI1A, ptr @_ZN1A3fooEv, ptr @_ZN1A3barEv], align 8 +@_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 123f735..7d590d3 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 00b004d..baef8b5 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 d5b4a40..5b731fc 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 accdbfa..b70fa6b 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 0997f3e..25866be 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 ) ; [#uses=2] - %tmp1 = bitcast i8* %tmp to i32* ; [#uses=0] - %tmp3 = bitcast i32* %tmp1 to i8* - %tmp2 = bitcast i8* %tmp3 to i32* ; [#uses=0] - ret i32* %tmp2 + %tmp = call ptr @m( i32 12 ) ; [#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 025aa21..a8a1e66 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 b064d15..0a1b351 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 ; [#uses=1] + %tmp2 = call i32 @strlen( ptr %P ) nounwind readonly ; [#uses=1] %tmp3 = icmp eq i32 %tmp2, 100 ; [#uses=1] %tmp34 = zext i1 %tmp3 to i8 ; [#uses=1] %toBool = icmp ne i8 %tmp34, 0 ; [#uses=1] @@ -19,7 +19,7 @@ bb: ; preds = %entry bb6: ; preds = %entry %tmp8 = add i32 %g, 42 ; [#uses=2] - %tmp10 = call i32 @strlen( i8* %P ) nounwind readonly ; [#uses=1] + %tmp10 = call i32 @strlen( ptr %P ) nounwind readonly ; [#uses=1] %tmp11 = icmp eq i32 %tmp10, 100 ; [#uses=1] %tmp1112 = zext i1 %tmp11 to i8 ; [#uses=1] %toBool13 = icmp ne i8 %tmp1112, 0 ; [#uses=1] @@ -30,7 +30,7 @@ bb14: ; preds = %bb6 bb16: ; preds = %bb6 %tmp18 = mul i32 %tmp8, 2 ; [#uses=1] - %tmp20 = call i32 @strlen( i8* %P ) nounwind readonly ; [#uses=1] + %tmp20 = call i32 @strlen( ptr %P ) nounwind readonly ; [#uses=1] %tmp21 = icmp eq i32 %tmp20, 100 ; [#uses=1] %tmp2122 = zext i1 %tmp21 to i8 ; [#uses=1] %toBool23 = icmp ne i8 %tmp2122, 0 ; [#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 95798be..68d74c1 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) ; [#uses=2] + %0 = tail call i32 @strlen(ptr %P) ; [#uses=2] %1 = icmp eq i32 %0, 0 ; [#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 ] ; [#uses=1] - %3 = tail call i8* @strchr(i8* %Q, i32 97) ; [#uses=1] - %4 = tail call i32 @strlen(i8* %P) ; [#uses=1] + %3 = tail call ptr @strchr(ptr %Q, i32 97) ; [#uses=1] + %4 = tail call i32 @strlen(ptr %P) ; [#uses=1] %5 = add i32 %x_addr.0, %0 ; [#uses=1] %.sum = sub i32 %5, %4 ; [#uses=1] - %6 = getelementptr i8, i8* %3, i32 %.sum ; [#uses=1] - ret i8* %6 + %6 = getelementptr i8, ptr %3, i32 %.sum ; [#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 73cfb6c..d968c78 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 ;