From: David Blaikie Date: Fri, 27 Feb 2015 19:29:02 +0000 (+0000) Subject: [opaque pointer type] Add textual IR support for explicit type parameter to getelemen... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=198d8baafbfdfcf5a5e219602a5d94ed263973b4;p=oota-llvm.git [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction One of several parallel first steps to remove the target type of pointers, replacing them with a single opaque pointer type. This adds an explicit type parameter to the gep instruction so that when the first parameter becomes an opaque pointer type, the type to gep through is still available to the instructions. * This doesn't modify gep operators, only instructions (operators will be handled separately) * Textual IR changes only. Bitcode (including upgrade) and changing the in-memory representation will be in separate changes. * geps of vectors are transformed as: getelementptr <4 x float*> %x, ... ->getelementptr float, <4 x float*> %x, ... Then, once the opaque pointer type is introduced, this will ultimately look like: getelementptr float, <4 x ptr> %x with the unambiguous interpretation that it is a vector of pointers to float. * address spaces remain on the pointer, not the type: getelementptr float addrspace(1)* %x ->getelementptr float, float addrspace(1)* %x Then, eventually: getelementptr float, ptr addrspace(1) %x Importantly, the massive amount of test case churn has been automated by same crappy python code. I had to manually update a few test cases that wouldn't fit the script's model (r228970,r229196,r229197,r229198). The python script just massages stdin and writes the result to stdout, I then wrapped that in a shell script to handle replacing files, then using the usual find+xargs to migrate all the files. update.py: import fileinput import sys import re ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))") normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))") def conv(match, line): if not match: return line line = match.groups()[0] if len(match.groups()[5]) == 0: line += match.groups()[2] line += match.groups()[3] line += ", " line += match.groups()[1] line += "\n" return line for line in sys.stdin: if line.find("getelementptr ") == line.find("getelementptr inbounds"): if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("): line = conv(re.match(ibrep, line), line) elif line.find("getelementptr ") != line.find("getelementptr ("): line = conv(re.match(normrep, line), line) sys.stdout.write(line) apply.sh: for name in "$@" do python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name" rm -f "$name.tmp" done The actual commands: From llvm/src: find test/ -name *.ll | xargs ./apply.sh From llvm/src/tools/clang: find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}" From llvm/src/tools/polly: find test/ -name *.ll | xargs ./apply.sh After that, check-all (with llvm, clang, clang-tools-extra, lld, compiler-rt, and polly all checked out). The extra 'rm' in the apply.sh script is due to a few files in clang's test suite using interesting unicode stuff that my python script was throwing exceptions on. None of those files needed to be migrated, so it seemed sufficient to ignore those cases. Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7636 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 9e7354e02f7..4244679c814 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -5440,7 +5440,19 @@ int LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) { bool InBounds = EatIfPresent(lltok::kw_inbounds); - if (ParseTypeAndValue(Ptr, Loc, PFS)) return true; + Type *Ty = nullptr; + LocTy ExplicitTypeLoc = Lex.getLoc(); + if (ParseType(Ty) || + ParseToken(lltok::comma, "expected comma after getelementptr's type") || + ParseTypeAndValue(Ptr, Loc, PFS)) + return true; + + Type *PtrTy = Ptr->getType(); + if (VectorType *VT = dyn_cast(PtrTy)) + PtrTy = VT->getElementType(); + if (Ty != cast(PtrTy)->getElementType()) + return Error(ExplicitTypeLoc, + "explicit pointee type doesn't match operand's pointee type"); Type *BaseType = Ptr->getType(); PointerType *BasePointerType = dyn_cast(BaseType->getScalarType()); diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index de0e614c876..8f3e5ec9229 100644 --- a/lib/IR/AsmWriter.cpp +++ b/lib/IR/AsmWriter.cpp @@ -2898,6 +2898,11 @@ void AssemblyWriter::printInstruction(const Instruction &I) { Out << ", "; TypePrinter.print(I.getType(), Out); } else if (Operand) { // Print the normal way. + if (const GetElementPtrInst *GEP = dyn_cast(&I)) { + Out << ' '; + TypePrinter.print(GEP->getSourceElementType(), Out); + Out << ','; + } // PrintAllTypes - Instructions who have operands of all the same type // omit the type from all but the first operand. If the instruction has diff --git a/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll b/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll index 45f6088eaf0..b597ff89eb5 100644 --- a/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll +++ b/test/Analysis/BasicAA/2003-02-26-AccessSizeTest.ll @@ -11,7 +11,7 @@ define i32 @test() { store i32 0, i32* %A %X = load i32* %A %B = bitcast i32* %A to i8* - %C = getelementptr i8* %B, i64 1 + %C = getelementptr i8, i8* %B, i64 1 store i8 1, i8* %C ; Aliases %A %Y.DONOTREMOVE = load i32* %A %Z = sub i32 %X, %Y.DONOTREMOVE diff --git a/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll b/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll index 4f8eabb7930..5a93b3da054 100644 --- a/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll +++ b/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll @@ -1,7 +1,7 @@ ; RUN: opt < %s -basicaa -aa-eval -disable-output 2>/dev/null ; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2 define void @test({[2 x i32],[2 x i32]}* %A, i64 %X, i64 %Y) { - %P1 = getelementptr {[2 x i32],[2 x i32]}* %A, i64 0, i32 0, i64 %X - %P2 = getelementptr {[2 x i32],[2 x i32]}* %A, i64 0, i32 1, i64 %Y + %P1 = getelementptr {[2 x i32],[2 x i32]}, {[2 x i32],[2 x i32]}* %A, i64 0, i32 0, i64 %X + %P2 = getelementptr {[2 x i32],[2 x i32]}, {[2 x i32],[2 x i32]}* %A, i64 0, i32 1, i64 %Y ret void } diff --git a/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll b/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll index 78f74a0abe5..c72ec817011 100644 --- a/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll +++ b/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll @@ -4,8 +4,8 @@ define i32 @test(i32 *%Ptr, i64 %V) { ; CHECK: sub i32 %X, %Y - %P2 = getelementptr i32* %Ptr, i64 1 - %P1 = getelementptr i32* %Ptr, i64 %V + %P2 = getelementptr i32, i32* %Ptr, i64 1 + %P1 = getelementptr i32, i32* %Ptr, i64 %V %X = load i32* %P1 store i32 5, i32* %P2 %Y = load i32* %P1 diff --git a/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll b/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll index 97bc38eb69b..ea26c220072 100644 --- a/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll +++ b/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll @@ -1,7 +1,7 @@ ; RUN: opt < %s -basicaa -aa-eval -disable-output 2>/dev/null ; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2 define void @test([17 x i16]* %mask_bits) { - %P1 = getelementptr [17 x i16]* %mask_bits, i64 0, i64 0 - %P2 = getelementptr [17 x i16]* %mask_bits, i64 252645134, i64 0 + %P1 = getelementptr [17 x i16], [17 x i16]* %mask_bits, i64 0, i64 0 + %P2 = getelementptr [17 x i16], [17 x i16]* %mask_bits, i64 252645134, i64 0 ret void } diff --git a/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll b/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll index 8ca34698559..dbda9542a9a 100644 --- a/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll +++ b/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll @@ -6,13 +6,13 @@ define void @table_reindex(%struct..apr_table_t* %t.1) { ; No predecessors! br label %loopentry loopentry: ; preds = %0, %no_exit - %tmp.101 = getelementptr %struct..apr_table_t* %t.1, i64 0, i32 0, i32 2 + %tmp.101 = getelementptr %struct..apr_table_t, %struct..apr_table_t* %t.1, i64 0, i32 0, i32 2 %tmp.11 = load i32* %tmp.101 ; [#uses=0] br i1 false, label %no_exit, label %UnifiedExitNode no_exit: ; preds = %loopentry %tmp.25 = sext i32 0 to i64 ; [#uses=1] - %tmp.261 = getelementptr %struct..apr_table_t* %t.1, i64 0, i32 3, i64 %tmp.25 ; [#uses=1] + %tmp.261 = getelementptr %struct..apr_table_t, %struct..apr_table_t* %t.1, i64 0, i32 3, i64 %tmp.25 ; [#uses=1] store i32 0, i32* %tmp.261 br label %loopentry diff --git a/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll b/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll index 0abd3847836..305546ba77f 100644 --- a/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll +++ b/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll @@ -1,11 +1,11 @@ ; RUN: opt < %s -basicaa -aa-eval -disable-output 2>/dev/null define i32 @MTConcat([3 x i32]* %a.1) { - %tmp.961 = getelementptr [3 x i32]* %a.1, i64 0, i64 4 + %tmp.961 = getelementptr [3 x i32], [3 x i32]* %a.1, i64 0, i64 4 %tmp.97 = load i32* %tmp.961 - %tmp.119 = getelementptr [3 x i32]* %a.1, i64 1, i64 0 + %tmp.119 = getelementptr [3 x i32], [3 x i32]* %a.1, i64 1, i64 0 %tmp.120 = load i32* %tmp.119 - %tmp.1541 = getelementptr [3 x i32]* %a.1, i64 0, i64 4 + %tmp.1541 = getelementptr [3 x i32], [3 x i32]* %a.1, i64 0, i64 4 %tmp.155 = load i32* %tmp.1541 ret i32 0 } diff --git a/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll b/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll index 3e813fa2ca1..7aaae2a1927 100644 --- a/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll +++ b/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll @@ -4,7 +4,7 @@ %struct..RefRect = type { %struct..RefPoint, %struct..RefPoint } define i32 @BMT_CommitPartDrawObj() { - %tmp.19111 = getelementptr %struct..RefRect* null, i64 0, i32 0, i32 1, i32 2 - %tmp.20311 = getelementptr %struct..RefRect* null, i64 0, i32 1, i32 1, i32 2 + %tmp.19111 = getelementptr %struct..RefRect, %struct..RefRect* null, i64 0, i32 0, i32 1, i32 2 + %tmp.20311 = getelementptr %struct..RefRect, %struct..RefRect* null, i64 0, i32 1, i32 1, i32 2 ret i32 0 } diff --git a/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll b/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll index f2b06cb8143..f8d4195c46c 100644 --- a/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll +++ b/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll @@ -11,10 +11,10 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ; CHECK-NOT: MayAlias: define void @test(%T* %P) { - %A = getelementptr %T* %P, i64 0 - %B = getelementptr %T* %P, i64 0, i32 0 - %C = getelementptr %T* %P, i64 0, i32 1 - %D = getelementptr %T* %P, i64 0, i32 1, i64 0 - %E = getelementptr %T* %P, i64 0, i32 1, i64 5 + %A = getelementptr %T, %T* %P, i64 0 + %B = getelementptr %T, %T* %P, i64 0, i32 0 + %C = getelementptr %T, %T* %P, i64 0, i32 1 + %D = getelementptr %T, %T* %P, i64 0, i32 1, i64 0 + %E = getelementptr %T, %T* %P, i64 0, i32 1, i64 5 ret void } diff --git a/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll b/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll index 42512b8f6bf..52d10d2e056 100644 --- a/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll +++ b/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll @@ -13,10 +13,10 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ; CHECK-NOT: MayAlias: define void @test() { - %D = getelementptr %T* @G, i64 0, i32 0 - %E = getelementptr %T* @G, i64 0, i32 1, i64 5 - %F = getelementptr i32* getelementptr (%T* @G, i64 0, i32 0), i64 0 - %X = getelementptr [10 x i8]* getelementptr (%T* @G, i64 0, i32 1), i64 0, i64 5 + %D = getelementptr %T, %T* @G, i64 0, i32 0 + %E = getelementptr %T, %T* @G, i64 0, i32 1, i64 5 + %F = getelementptr i32, i32* getelementptr (%T* @G, i64 0, i32 0), i64 0 + %X = getelementptr [10 x i8], [10 x i8]* getelementptr (%T* @G, i64 0, i32 1), i64 0, i64 5 ret void } diff --git a/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll b/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll index 578aa5943cb..16573a7f9af 100644 --- a/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll +++ b/test/Analysis/BasicAA/2004-07-28-MustAliasbug.ll @@ -2,9 +2,9 @@ define void @test({i32,i32 }* %P) { ; CHECK: store i32 0, i32* %X - %Q = getelementptr {i32,i32}* %P, i32 1 - %X = getelementptr {i32,i32}* %Q, i32 0, i32 1 - %Y = getelementptr {i32,i32}* %Q, i32 1, i32 1 + %Q = getelementptr {i32,i32}, {i32,i32}* %P, i32 1 + %X = getelementptr {i32,i32}, {i32,i32}* %Q, i32 0, i32 1 + %Y = getelementptr {i32,i32}, {i32,i32}* %Q, i32 1, i32 1 store i32 0, i32* %X store i32 1, i32* %Y ret void diff --git a/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll b/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll index 06a804c392f..104d2bf350c 100644 --- a/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll +++ b/test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll @@ -12,11 +12,11 @@ entry: no_exit: ; preds = %no_exit, %entry %i.0.0 = phi i32 [ 0, %entry ], [ %inc, %no_exit ] ; [#uses=2] - %tmp.6 = getelementptr [3 x [3 x i32]]* %X, i32 0, i32 0, i32 %i.0.0 ; [#uses=1] + %tmp.6 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 0, i32 %i.0.0 ; [#uses=1] store i32 1, i32* %tmp.6 - %tmp.8 = getelementptr [3 x [3 x i32]]* %X, i32 0, i32 0, i32 0 ; [#uses=1] + %tmp.8 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 0, i32 0 ; [#uses=1] %tmp.9 = load i32* %tmp.8 ; [#uses=1] - %tmp.11 = getelementptr [3 x [3 x i32]]* %X, i32 0, i32 1, i32 0 ; [#uses=1] + %tmp.11 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 1, i32 0 ; [#uses=1] %tmp.12 = load i32* %tmp.11 ; [#uses=1] %tmp.13 = add i32 %tmp.12, %tmp.9 ; [#uses=1] %inc = add i32 %i.0.0, 1 ; [#uses=2] @@ -25,7 +25,7 @@ no_exit: ; preds = %no_exit, %entry loopexit: ; preds = %no_exit, %entry %Y.0.1 = phi i32 [ 0, %entry ], [ %tmp.13, %no_exit ] ; [#uses=1] - %tmp.4 = getelementptr [3 x [3 x i32]]* %X, i32 0, i32 0 ; <[3 x i32]*> [#uses=1] + %tmp.4 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 0 ; <[3 x i32]*> [#uses=1] %tmp.15 = call i32 (...)* @foo( [3 x i32]* %tmp.4, i32 %Y.0.1 ) ; [#uses=0] ret void } diff --git a/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll b/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll index 0db58156547..a331f7e4955 100644 --- a/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll +++ b/test/Analysis/BasicAA/2006-11-03-BasicAAVectorCrash.ll @@ -22,7 +22,7 @@ cond_true264.i: ; preds = %bb239.i ret void cond_false277.i: ; preds = %bb239.i - %tmp1062.i = getelementptr [2 x <4 x i32>]* null, i32 0, i32 1 ; <<4 x i32>*> [#uses=1] + %tmp1062.i = getelementptr [2 x <4 x i32>], [2 x <4 x i32>]* null, i32 0, i32 1 ; <<4 x i32>*> [#uses=1] store <4 x i32> zeroinitializer, <4 x i32>* %tmp1062.i br i1 false, label %cond_true1032.i, label %cond_false1063.i85 @@ -33,7 +33,7 @@ bb1013.i: ; preds = %bb205.i ret void cond_true1032.i: ; preds = %cond_false277.i - %tmp1187.i = getelementptr [2 x <4 x i32>]* null, i32 0, i32 0, i32 7 ; [#uses=1] + %tmp1187.i = getelementptr [2 x <4 x i32>], [2 x <4 x i32>]* null, i32 0, i32 0, i32 7 ; [#uses=1] store i32 0, i32* %tmp1187.i br label %bb2037.i diff --git a/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll b/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll index 46b6aaf91ac..14d7f58d38a 100644 --- a/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll +++ b/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll @@ -21,11 +21,11 @@ target triple = "i686-apple-darwin8" ; CHECK: ret i32 %Z define i32 @test(%struct.closure_type* %tmp18169) { - %tmp18174 = getelementptr %struct.closure_type* %tmp18169, i32 0, i32 4, i32 0, i32 0 ; [#uses=2] + %tmp18174 = getelementptr %struct.closure_type, %struct.closure_type* %tmp18169, i32 0, i32 4, i32 0, i32 0 ; [#uses=2] %tmp18269 = bitcast i32* %tmp18174 to %struct.STYLE* ; <%struct.STYLE*> [#uses=1] %A = load i32* %tmp18174 ; [#uses=1] - %tmp18272 = getelementptr %struct.STYLE* %tmp18269, i32 0, i32 0, i32 0, i32 2 ; [#uses=1] + %tmp18272 = getelementptr %struct.STYLE, %struct.STYLE* %tmp18269, i32 0, i32 0, i32 0, i32 2 ; [#uses=1] store i16 123, i16* %tmp18272 %Q = load i32* %tmp18174 ; [#uses=1] diff --git a/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll b/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll index d11e75dfb7d..8388d6c97ad 100644 --- a/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll +++ b/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll @@ -8,10 +8,10 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ; CHECK: 6 partial alias responses define void @foo(i32* noalias %p, i32* noalias %q, i32 %i, i32 %j) { - %Ipointer = getelementptr i32* %p, i32 %i - %qi = getelementptr i32* %q, i32 %i - %Jpointer = getelementptr i32* %p, i32 %j - %qj = getelementptr i32* %q, i32 %j + %Ipointer = getelementptr i32, i32* %p, i32 %i + %qi = getelementptr i32, i32* %q, i32 %i + %Jpointer = getelementptr i32, i32* %p, i32 %j + %qj = getelementptr i32, i32* %q, i32 %j store i32 0, i32* %p store i32 0, i32* %Ipointer store i32 0, i32* %Jpointer diff --git a/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll b/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll index 429160ef6d5..e0e64fb9f93 100644 --- a/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll +++ b/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll @@ -9,7 +9,7 @@ define i32 @_Z3fooP1A(%struct.A* %b) { ; CHECK: ret i32 %tmp7 entry: store i32 1, i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8 - %tmp4 = getelementptr %struct.A* %b, i32 0, i32 0 ; [#uses=1] + %tmp4 = getelementptr %struct.A, %struct.A* %b, i32 0, i32 0 ; [#uses=1] store i32 0, i32* %tmp4, align 4 %tmp7 = load i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8 ; [#uses=1] ret i32 %tmp7 diff --git a/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll b/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll index 32d9930f427..8014a24ee25 100644 --- a/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll +++ b/test/Analysis/BasicAA/2007-11-05-SizeCrash.ll @@ -14,14 +14,14 @@ target triple = "x86_64-unknown-linux-gnu" define i32 @uhci_suspend(%struct.usb_hcd* %hcd) { entry: - %tmp17 = getelementptr %struct.usb_hcd* %hcd, i32 0, i32 2, i64 1 + %tmp17 = getelementptr %struct.usb_hcd, %struct.usb_hcd* %hcd, i32 0, i32 2, i64 1 ; [#uses=1] %tmp1718 = bitcast i64* %tmp17 to i32* ; [#uses=1] %tmp19 = load i32* %tmp1718, align 4 ; [#uses=0] br i1 false, label %cond_true34, label %done_okay cond_true34: ; preds = %entry - %tmp631 = getelementptr %struct.usb_hcd* %hcd, i32 0, i32 2, i64 + %tmp631 = getelementptr %struct.usb_hcd, %struct.usb_hcd* %hcd, i32 0, i32 2, i64 2305843009213693950 ; [#uses=1] %tmp70 = bitcast i64* %tmp631 to %struct.device** diff --git a/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll b/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll index cd997ea5251..ceba1d24a7e 100644 --- a/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll +++ b/test/Analysis/BasicAA/2007-12-08-OutOfBoundsCrash.ll @@ -13,7 +13,7 @@ target triple = "x86_64-unknown-linux-gnu" define i32 @ehci_pci_setup(%struct.usb_hcd* %hcd) { entry: - %tmp14 = getelementptr %struct.usb_hcd* %hcd, i32 0, i32 0, i32 0 ; <%struct.device**> [#uses=1] + %tmp14 = getelementptr %struct.usb_hcd, %struct.usb_hcd* %hcd, i32 0, i32 0, i32 0 ; <%struct.device**> [#uses=1] %tmp15 = load %struct.device** %tmp14, align 8 ; <%struct.device*> [#uses=0] br i1 false, label %bb25, label %return @@ -21,7 +21,7 @@ bb25: ; preds = %entry br i1 false, label %cond_true, label %return cond_true: ; preds = %bb25 - %tmp601 = getelementptr %struct.usb_hcd* %hcd, i32 0, i32 1, i64 2305843009213693951 ; [#uses=1] + %tmp601 = getelementptr %struct.usb_hcd, %struct.usb_hcd* %hcd, i32 0, i32 1, i64 2305843009213693951 ; [#uses=1] %tmp67 = bitcast i64* %tmp601 to %struct.device** ; <%struct.device**> [#uses=1] %tmp68 = load %struct.device** %tmp67, align 8 ; <%struct.device*> [#uses=0] ret i32 undef diff --git a/test/Analysis/BasicAA/2008-04-15-Byval.ll b/test/Analysis/BasicAA/2008-04-15-Byval.ll index 2ea0314d5b6..9df12bdd570 100644 --- a/test/Analysis/BasicAA/2008-04-15-Byval.ll +++ b/test/Analysis/BasicAA/2008-04-15-Byval.ll @@ -7,8 +7,8 @@ target triple = "i386-apple-darwin8" define void @foo(%struct.x* byval align 4 %X) nounwind { ; CHECK: store i32 2, i32* %tmp1 entry: - %tmp = getelementptr %struct.x* %X, i32 0, i32 0 ; <[4 x i32]*> [#uses=1] - %tmp1 = getelementptr [4 x i32]* %tmp, i32 0, i32 3 ; [#uses=1] + %tmp = getelementptr %struct.x, %struct.x* %X, i32 0, i32 0 ; <[4 x i32]*> [#uses=1] + %tmp1 = getelementptr [4 x i32], [4 x i32]* %tmp, i32 0, i32 3 ; [#uses=1] store i32 2, i32* %tmp1, align 4 %tmp2 = call i32 (...)* @bar( %struct.x* byval align 4 %X ) nounwind ; [#uses=0] br label %return diff --git a/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll b/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll index add7dee0fe1..643d54dfaf3 100644 --- a/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll +++ b/test/Analysis/BasicAA/2009-03-04-GEPNoalias.ll @@ -6,7 +6,7 @@ define i32 @test(i32 %x) { ; CHECK: load i32* %a %a = call i32* @noalias() store i32 1, i32* %a - %b = getelementptr i32* %a, i32 %x + %b = getelementptr i32, i32* %a, i32 %x store i32 2, i32* %b %c = load i32* %a diff --git a/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll b/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll index 4b6a12e821e..8704d19465c 100644 --- a/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll +++ b/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll @@ -2,8 +2,8 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" define i8 @foo(i8* %ptr) { - %P = getelementptr i8* %ptr, i32 0 - %Q = getelementptr i8* %ptr, i32 1 + %P = getelementptr i8, i8* %ptr, i32 0 + %Q = getelementptr i8, i8* %ptr, i32 1 ; CHECK: getelementptr %X = load i8* %P %Y = atomicrmw add i8* %Q, i8 1 monotonic diff --git a/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll b/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll index c546d68f425..a2515a61461 100644 --- a/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll +++ b/test/Analysis/BasicAA/2009-10-13-GEP-BaseNoAlias.ll @@ -15,7 +15,7 @@ entry: br i1 %tmp, label %bb, label %bb1 bb: - %b = getelementptr i32* %a, i32 0 + %b = getelementptr i32, i32* %a, i32 0 br label %bb2 bb1: diff --git a/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll b/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll index 66569808fb6..40c65af107d 100644 --- a/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll +++ b/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll @@ -8,7 +8,7 @@ target datalayout = "e-p:32:32:32" define i32 @test(i32* %tab, i32 %indvar) nounwind { %tmp31 = mul i32 %indvar, -2 %tmp32 = add i32 %tmp31, 30 - %t.5 = getelementptr i32* %tab, i32 %tmp32 + %t.5 = getelementptr i32, i32* %tab, i32 %tmp32 %loada = load i32* %tab store i32 0, i32* %t.5 %loadb = load i32* %tab diff --git a/test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll b/test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll index bc2512eca0c..82e8044635e 100644 --- a/test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll +++ b/test/Analysis/BasicAA/2014-03-18-Maxlookup-reached.ll @@ -10,25 +10,25 @@ target datalayout = "e" define i32 @main() { %t = alloca %struct.foo, align 4 - %1 = getelementptr inbounds %struct.foo* %t, i32 0, i32 0 + %1 = getelementptr inbounds %struct.foo, %struct.foo* %t, i32 0, i32 0 store i32 1, i32* %1, align 4 - %2 = getelementptr inbounds %struct.foo* %t, i64 1 + %2 = getelementptr inbounds %struct.foo, %struct.foo* %t, i64 1 %3 = bitcast %struct.foo* %2 to i8* - %4 = getelementptr inbounds i8* %3, i32 -1 + %4 = getelementptr inbounds i8, i8* %3, i32 -1 store i8 0, i8* %4 - %5 = getelementptr inbounds i8* %4, i32 -1 + %5 = getelementptr inbounds i8, i8* %4, i32 -1 store i8 0, i8* %5 - %6 = getelementptr inbounds i8* %5, i32 -1 + %6 = getelementptr inbounds i8, i8* %5, i32 -1 store i8 0, i8* %6 - %7 = getelementptr inbounds i8* %6, i32 -1 + %7 = getelementptr inbounds i8, i8* %6, i32 -1 store i8 0, i8* %7 - %8 = getelementptr inbounds i8* %7, i32 -1 + %8 = getelementptr inbounds i8, i8* %7, i32 -1 store i8 0, i8* %8 - %9 = getelementptr inbounds i8* %8, i32 -1 + %9 = getelementptr inbounds i8, i8* %8, i32 -1 store i8 0, i8* %9 - %10 = getelementptr inbounds i8* %9, i32 -1 + %10 = getelementptr inbounds i8, i8* %9, i32 -1 store i8 0, i8* %10 - %11 = getelementptr inbounds i8* %10, i32 -1 + %11 = getelementptr inbounds i8, i8* %10, i32 -1 store i8 0, i8* %11 %12 = load i32* %1, align 4 ret i32 %12 diff --git a/test/Analysis/BasicAA/byval.ll b/test/Analysis/BasicAA/byval.ll index 673fee01cc8..260aebe2985 100644 --- a/test/Analysis/BasicAA/byval.ll +++ b/test/Analysis/BasicAA/byval.ll @@ -7,7 +7,7 @@ target triple = "i686-apple-darwin8" define i32 @foo(%struct.x* byval %a) nounwind { ; CHECK: ret i32 1 %tmp1 = tail call i32 (...)* @bar( %struct.x* %a ) nounwind ; [#uses=0] - %tmp2 = getelementptr %struct.x* %a, i32 0, i32 0 ; [#uses=2] + %tmp2 = getelementptr %struct.x, %struct.x* %a, i32 0, i32 0 ; [#uses=2] store i32 1, i32* %tmp2, align 4 store i32 2, i32* @g, align 4 %tmp4 = load i32* %tmp2, align 4 ; [#uses=1] diff --git a/test/Analysis/BasicAA/constant-over-index.ll b/test/Analysis/BasicAA/constant-over-index.ll index aeb068b24aa..f5e2c7c1361 100644 --- a/test/Analysis/BasicAA/constant-over-index.ll +++ b/test/Analysis/BasicAA/constant-over-index.ll @@ -11,13 +11,13 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" define void @foo([3 x [3 x double]]* noalias %p) { entry: - %p3 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 0, i64 3 + %p3 = getelementptr [3 x [3 x double]], [3 x [3 x double]]* %p, i64 0, i64 0, i64 3 br label %loop loop: %i = phi i64 [ 0, %entry ], [ %i.next, %loop ] - %p.0.i.0 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 %i, i64 0 + %p.0.i.0 = getelementptr [3 x [3 x double]], [3 x [3 x double]]* %p, i64 0, i64 %i, i64 0 store volatile double 0.0, double* %p3 store volatile double 0.1, double* %p.0.i.0 diff --git a/test/Analysis/BasicAA/cs-cs.ll b/test/Analysis/BasicAA/cs-cs.ll index 693634c0414..78670b61ca1 100644 --- a/test/Analysis/BasicAA/cs-cs.ll +++ b/test/Analysis/BasicAA/cs-cs.ll @@ -12,7 +12,7 @@ declare void @a_readonly_func(i8 *) noinline nounwind readonly define <8 x i16> @test1(i8* %p, <8 x i16> %y) { entry: - %q = getelementptr i8* %p, i64 16 + %q = getelementptr i8, i8* %p, i64 16 %a = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) nounwind call void @llvm.arm.neon.vst1.v8i16(i8* %q, <8 x i16> %y, i32 16) %b = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) nounwind @@ -70,7 +70,7 @@ define void @test2a(i8* noalias %P, i8* noalias %Q) nounwind ssp { define void @test2b(i8* noalias %P, i8* noalias %Q) nounwind ssp { tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) - %R = getelementptr i8* %P, i64 12 + %R = getelementptr i8, i8* %P, i64 12 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) ret void @@ -91,7 +91,7 @@ define void @test2b(i8* noalias %P, i8* noalias %Q) nounwind ssp { define void @test2c(i8* noalias %P, i8* noalias %Q) nounwind ssp { tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) - %R = getelementptr i8* %P, i64 11 + %R = getelementptr i8, i8* %P, i64 11 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) ret void @@ -112,7 +112,7 @@ define void @test2c(i8* noalias %P, i8* noalias %Q) nounwind ssp { define void @test2d(i8* noalias %P, i8* noalias %Q) nounwind ssp { tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) - %R = getelementptr i8* %P, i64 -12 + %R = getelementptr i8, i8* %P, i64 -12 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) ret void @@ -133,7 +133,7 @@ define void @test2d(i8* noalias %P, i8* noalias %Q) nounwind ssp { define void @test2e(i8* noalias %P, i8* noalias %Q) nounwind ssp { tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) - %R = getelementptr i8* %P, i64 -11 + %R = getelementptr i8, i8* %P, i64 -11 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) ret void diff --git a/test/Analysis/BasicAA/featuretest.ll b/test/Analysis/BasicAA/featuretest.ll index 47d278fab1c..19e9b16b0e2 100644 --- a/test/Analysis/BasicAA/featuretest.ll +++ b/test/Analysis/BasicAA/featuretest.ll @@ -18,10 +18,10 @@ define i32 @different_array_test(i64 %A, i64 %B) { call void @external(i32* %Array1) call void @external(i32* %Array2) - %pointer = getelementptr i32* %Array1, i64 %A + %pointer = getelementptr i32, i32* %Array1, i64 %A %val = load i32* %pointer - %pointer2 = getelementptr i32* %Array2, i64 %B + %pointer2 = getelementptr i32, i32* %Array2, i64 %B store i32 7, i32* %pointer2 %REMOVE = load i32* %pointer ; redundant with above load @@ -38,8 +38,8 @@ define i32 @constant_array_index_test() { %Array = alloca i32, i32 100 call void @external(i32* %Array) - %P1 = getelementptr i32* %Array, i64 7 - %P2 = getelementptr i32* %Array, i64 6 + %P1 = getelementptr i32, i32* %Array, i64 7 + %P2 = getelementptr i32, i32* %Array, i64 6 %A = load i32* %P1 store i32 1, i32* %P2 ; Should not invalidate load @@ -54,7 +54,7 @@ define i32 @constant_array_index_test() { ; they cannot alias. define i32 @gep_distance_test(i32* %A) { %REMOVEu = load i32* %A - %B = getelementptr i32* %A, i64 2 ; Cannot alias A + %B = getelementptr i32, i32* %A, i64 2 ; Cannot alias A store i32 7, i32* %B %REMOVEv = load i32* %A %r = sub i32 %REMOVEu, %REMOVEv @@ -66,9 +66,9 @@ define i32 @gep_distance_test(i32* %A) { ; Test that if two pointers are spaced out by a constant offset, that they ; cannot alias, even if there is a variable offset between them... define i32 @gep_distance_test2({i32,i32}* %A, i64 %distance) { - %A1 = getelementptr {i32,i32}* %A, i64 0, i32 0 + %A1 = getelementptr {i32,i32}, {i32,i32}* %A, i64 0, i32 0 %REMOVEu = load i32* %A1 - %B = getelementptr {i32,i32}* %A, i64 %distance, i32 1 + %B = getelementptr {i32,i32}, {i32,i32}* %A, i64 %distance, i32 1 store i32 7, i32* %B ; B cannot alias A, it's at least 4 bytes away %REMOVEv = load i32* %A1 %r = sub i32 %REMOVEu, %REMOVEv @@ -82,7 +82,7 @@ define i32 @gep_distance_test2({i32,i32}* %A, i64 %distance) { define i32 @gep_distance_test3(i32 * %A) { %X = load i32* %A %B = bitcast i32* %A to i8* - %C = getelementptr i8* %B, i64 4 + %C = getelementptr i8, i8* %B, i64 4 store i8 42, i8* %C %Y = load i32* %A %R = sub i32 %X, %Y @@ -112,12 +112,12 @@ define i32 @constexpr_test() { define i16 @zext_sext_confusion(i16* %row2col, i5 %j) nounwind{ entry: %sum5.cast = zext i5 %j to i64 ; [#uses=1] - %P1 = getelementptr i16* %row2col, i64 %sum5.cast + %P1 = getelementptr i16, i16* %row2col, i64 %sum5.cast %row2col.load.1.2 = load i16* %P1, align 1 ; [#uses=1] %sum13.cast31 = sext i5 %j to i6 ; [#uses=1] %sum13.cast = zext i6 %sum13.cast31 to i64 ; [#uses=1] - %P2 = getelementptr i16* %row2col, i64 %sum13.cast + %P2 = getelementptr i16, i16* %row2col, i64 %sum13.cast %row2col.load.1.6 = load i16* %P2, align 1 ; [#uses=1] %.ret = sub i16 %row2col.load.1.6, %row2col.load.1.2 ; [#uses=1] diff --git a/test/Analysis/BasicAA/full-store-partial-alias.ll b/test/Analysis/BasicAA/full-store-partial-alias.ll index 9699d92ea83..e046e13ad9f 100644 --- a/test/Analysis/BasicAA/full-store-partial-alias.ll +++ b/test/Analysis/BasicAA/full-store-partial-alias.ll @@ -18,12 +18,12 @@ define i32 @signbit(double %x) nounwind { ; CHECK: ret i32 0 entry: %u = alloca %union.anon, align 8 - %tmp9 = getelementptr inbounds %union.anon* %u, i64 0, i32 0 + %tmp9 = getelementptr inbounds %union.anon, %union.anon* %u, i64 0, i32 0 store double %x, double* %tmp9, align 8, !tbaa !0 %tmp2 = load i32* bitcast (i64* @endianness_test to i32*), align 8, !tbaa !3 %idxprom = sext i32 %tmp2 to i64 %tmp4 = bitcast %union.anon* %u to [2 x i32]* - %arrayidx = getelementptr inbounds [2 x i32]* %tmp4, i64 0, i64 %idxprom + %arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %tmp4, i64 0, i64 %idxprom %tmp5 = load i32* %arrayidx, align 4, !tbaa !3 %tmp5.lobit = lshr i32 %tmp5, 31 ret i32 %tmp5.lobit diff --git a/test/Analysis/BasicAA/gep-alias.ll b/test/Analysis/BasicAA/gep-alias.ll index 2c0d467003f..3f2e88a9459 100644 --- a/test/Analysis/BasicAA/gep-alias.ll +++ b/test/Analysis/BasicAA/gep-alias.ll @@ -6,11 +6,11 @@ target datalayout = "e-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32- define i32 @test1(i8 * %P) { entry: %Q = bitcast i8* %P to {i32, i32}* - %R = getelementptr {i32, i32}* %Q, i32 0, i32 1 + %R = getelementptr {i32, i32}, {i32, i32}* %Q, i32 0, i32 1 %S = load i32* %R %q = bitcast i8* %P to {i32, i32}* - %r = getelementptr {i32, i32}* %q, i32 0, i32 1 + %r = getelementptr {i32, i32}, {i32, i32}* %q, i32 0, i32 1 %s = load i32* %r %t = sub i32 %S, %s @@ -22,10 +22,10 @@ entry: define i32 @test2(i8 * %P) { entry: %Q = bitcast i8* %P to {i32, i32, i32}* - %R = getelementptr {i32, i32, i32}* %Q, i32 0, i32 1 + %R = getelementptr {i32, i32, i32}, {i32, i32, i32}* %Q, i32 0, i32 1 %S = load i32* %R - %r = getelementptr {i32, i32, i32}* %Q, i32 0, i32 2 + %r = getelementptr {i32, i32, i32}, {i32, i32, i32}* %Q, i32 0, i32 2 store i32 42, i32* %r %s = load i32* %R @@ -40,11 +40,11 @@ entry: ; This was a miscompilation. define i32 @test3({float, {i32, i32, i32}}* %P) { entry: - %P2 = getelementptr {float, {i32, i32, i32}}* %P, i32 0, i32 1 - %R = getelementptr {i32, i32, i32}* %P2, i32 0, i32 1 + %P2 = getelementptr {float, {i32, i32, i32}}, {float, {i32, i32, i32}}* %P, i32 0, i32 1 + %R = getelementptr {i32, i32, i32}, {i32, i32, i32}* %P2, i32 0, i32 1 %S = load i32* %R - %r = getelementptr {i32, i32, i32}* %P2, i32 0, i32 2 + %r = getelementptr {i32, i32, i32}, {i32, i32, i32}* %P2, i32 0, i32 2 store i32 42, i32* %r %s = load i32* %R @@ -62,9 +62,9 @@ entry: define i32 @test4(%SmallPtrSet64* %P) { entry: - %tmp2 = getelementptr inbounds %SmallPtrSet64* %P, i64 0, i32 0, i32 1 + %tmp2 = getelementptr inbounds %SmallPtrSet64, %SmallPtrSet64* %P, i64 0, i32 0, i32 1 store i32 64, i32* %tmp2, align 8 - %tmp3 = getelementptr inbounds %SmallPtrSet64* %P, i64 0, i32 0, i32 4, i64 64 + %tmp3 = getelementptr inbounds %SmallPtrSet64, %SmallPtrSet64* %P, i64 0, i32 0, i32 4, i64 64 store i8* null, i8** %tmp3, align 8 %tmp4 = load i32* %tmp2, align 8 ret i32 %tmp4 @@ -74,9 +74,9 @@ entry: ; P[i] != p[i+1] define i32 @test5(i32* %p, i64 %i) { - %pi = getelementptr i32* %p, i64 %i + %pi = getelementptr i32, i32* %p, i64 %i %i.next = add i64 %i, 1 - %pi.next = getelementptr i32* %p, i64 %i.next + %pi.next = getelementptr i32, i32* %p, i64 %i.next %x = load i32* %pi store i32 42, i32* %pi.next %y = load i32* %pi @@ -87,9 +87,9 @@ define i32 @test5(i32* %p, i64 %i) { } define i32 @test5_as1_smaller_size(i32 addrspace(1)* %p, i8 %i) { - %pi = getelementptr i32 addrspace(1)* %p, i8 %i + %pi = getelementptr i32, i32 addrspace(1)* %p, i8 %i %i.next = add i8 %i, 1 - %pi.next = getelementptr i32 addrspace(1)* %p, i8 %i.next + %pi.next = getelementptr i32, i32 addrspace(1)* %p, i8 %i.next %x = load i32 addrspace(1)* %pi store i32 42, i32 addrspace(1)* %pi.next %y = load i32 addrspace(1)* %pi @@ -101,9 +101,9 @@ define i32 @test5_as1_smaller_size(i32 addrspace(1)* %p, i8 %i) { } define i32 @test5_as1_same_size(i32 addrspace(1)* %p, i16 %i) { - %pi = getelementptr i32 addrspace(1)* %p, i16 %i + %pi = getelementptr i32, i32 addrspace(1)* %p, i16 %i %i.next = add i16 %i, 1 - %pi.next = getelementptr i32 addrspace(1)* %p, i16 %i.next + %pi.next = getelementptr i32, i32 addrspace(1)* %p, i16 %i.next %x = load i32 addrspace(1)* %pi store i32 42, i32 addrspace(1)* %pi.next %y = load i32 addrspace(1)* %pi @@ -116,9 +116,9 @@ define i32 @test5_as1_same_size(i32 addrspace(1)* %p, i16 %i) { ; P[i] != p[(i*4)|1] define i32 @test6(i32* %p, i64 %i1) { %i = shl i64 %i1, 2 - %pi = getelementptr i32* %p, i64 %i + %pi = getelementptr i32, i32* %p, i64 %i %i.next = or i64 %i, 1 - %pi.next = getelementptr i32* %p, i64 %i.next + %pi.next = getelementptr i32, i32* %p, i64 %i.next %x = load i32* %pi store i32 42, i32* %pi.next %y = load i32* %pi @@ -130,9 +130,9 @@ define i32 @test6(i32* %p, i64 %i1) { ; P[1] != P[i*4] define i32 @test7(i32* %p, i64 %i) { - %pi = getelementptr i32* %p, i64 1 + %pi = getelementptr i32, i32* %p, i64 1 %i.next = shl i64 %i, 2 - %pi.next = getelementptr i32* %p, i64 %i.next + %pi.next = getelementptr i32, i32* %p, i64 %i.next %x = load i32* %pi store i32 42, i32* %pi.next %y = load i32* %pi @@ -146,10 +146,10 @@ define i32 @test7(i32* %p, i64 %i) { ; PR1143 define i32 @test8(i32* %p, i16 %i) { %i1 = zext i16 %i to i32 - %pi = getelementptr i32* %p, i32 %i1 + %pi = getelementptr i32, i32* %p, i32 %i1 %i.next = add i16 %i, 1 %i.next2 = zext i16 %i.next to i32 - %pi.next = getelementptr i32* %p, i32 %i.next2 + %pi.next = getelementptr i32, i32* %p, i32 %i.next2 %x = load i32* %pi store i32 42, i32* %pi.next %y = load i32* %pi @@ -163,12 +163,12 @@ define i8 @test9([4 x i8] *%P, i32 %i, i32 %j) { %i2 = shl i32 %i, 2 %i3 = add i32 %i2, 1 ; P2 = P + 1 + 4*i - %P2 = getelementptr [4 x i8] *%P, i32 0, i32 %i3 + %P2 = getelementptr [4 x i8], [4 x i8] *%P, i32 0, i32 %i3 %j2 = shl i32 %j, 2 ; P4 = P + 4*j - %P4 = getelementptr [4 x i8]* %P, i32 0, i32 %j2 + %P4 = getelementptr [4 x i8], [4 x i8]* %P, i32 0, i32 %j2 %x = load i8* %P2 store i8 42, i8* %P4 @@ -183,10 +183,10 @@ define i8 @test10([4 x i8] *%P, i32 %i) { %i2 = shl i32 %i, 2 %i3 = add i32 %i2, 4 ; P2 = P + 4 + 4*i - %P2 = getelementptr [4 x i8] *%P, i32 0, i32 %i3 + %P2 = getelementptr [4 x i8], [4 x i8] *%P, i32 0, i32 %i3 ; P4 = P + 4*i - %P4 = getelementptr [4 x i8]* %P, i32 0, i32 %i2 + %P4 = getelementptr [4 x i8], [4 x i8]* %P, i32 0, i32 %i2 %x = load i8* %P2 store i8 42, i8* %P4 @@ -201,10 +201,10 @@ define i8 @test10([4 x i8] *%P, i32 %i) { define float @test11(i32 %indvar, [4 x [2 x float]]* %q) nounwind ssp { %tmp = mul i32 %indvar, -1 %dec = add i32 %tmp, 3 - %scevgep = getelementptr [4 x [2 x float]]* %q, i32 0, i32 %dec + %scevgep = getelementptr [4 x [2 x float]], [4 x [2 x float]]* %q, i32 0, i32 %dec %scevgep35 = bitcast [2 x float]* %scevgep to i64* - %arrayidx28 = getelementptr inbounds [4 x [2 x float]]* %q, i32 0, i32 0 - %y29 = getelementptr inbounds [2 x float]* %arrayidx28, i32 0, i32 1 + %arrayidx28 = getelementptr inbounds [4 x [2 x float]], [4 x [2 x float]]* %q, i32 0, i32 0 + %y29 = getelementptr inbounds [2 x float], [2 x float]* %arrayidx28, i32 0, i32 1 store float 1.0, float* %y29, align 4 store i64 0, i64* %scevgep35, align 4 %tmp30 = load float* %y29, align 4 @@ -216,9 +216,9 @@ define float @test11(i32 %indvar, [4 x [2 x float]]* %q) nounwind ssp { ; (This was a miscompilation.) define i32 @test12(i32 %x, i32 %y, i8* %p) nounwind { %a = bitcast i8* %p to [13 x i8]* - %b = getelementptr [13 x i8]* %a, i32 %x + %b = getelementptr [13 x i8], [13 x i8]* %a, i32 %x %c = bitcast [13 x i8]* %b to [15 x i8]* - %d = getelementptr [15 x i8]* %c, i32 %y, i32 8 + %d = getelementptr [15 x i8], [15 x i8]* %c, i32 %y, i32 8 %castd = bitcast i8* %d to i32* %castp = bitcast i8* %p to i32* store i32 1, i32* %castp diff --git a/test/Analysis/BasicAA/global-size.ll b/test/Analysis/BasicAA/global-size.ll index f081cb1e072..6d06698d8ae 100644 --- a/test/Analysis/BasicAA/global-size.ll +++ b/test/Analysis/BasicAA/global-size.ll @@ -35,9 +35,9 @@ define i16 @test1_as1(i32 addrspace(1)* %P) { ; CHECK-LABEL: @test2( define i8 @test2(i32 %tmp79, i32 %w.2, i32 %indvar89) nounwind { %tmp92 = add i32 %tmp79, %indvar89 - %arrayidx412 = getelementptr [0 x i8]* @window, i32 0, i32 %tmp92 + %arrayidx412 = getelementptr [0 x i8], [0 x i8]* @window, i32 0, i32 %tmp92 %tmp93 = add i32 %w.2, %indvar89 - %arrayidx416 = getelementptr [0 x i8]* @window, i32 0, i32 %tmp93 + %arrayidx416 = getelementptr [0 x i8], [0 x i8]* @window, i32 0, i32 %tmp93 %A = load i8* %arrayidx412, align 1 store i8 4, i8* %arrayidx416, align 1 diff --git a/test/Analysis/BasicAA/intrinsics.ll b/test/Analysis/BasicAA/intrinsics.ll index c1cf587204c..8c05587ce23 100644 --- a/test/Analysis/BasicAA/intrinsics.ll +++ b/test/Analysis/BasicAA/intrinsics.ll @@ -21,13 +21,13 @@ entry: ; CHECK: define <8 x i16> @test1(i8* %p, <8 x i16> %y) { ; CHECK-NEXT: entry: -; CHECK-NEXT: %q = getelementptr i8* %p, i64 16 +; CHECK-NEXT: %q = getelementptr i8, i8* %p, i64 16 ; CHECK-NEXT: %a = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) [[ATTR]] ; CHECK-NEXT: call void @llvm.arm.neon.vst1.v8i16(i8* %q, <8 x i16> %y, i32 16) ; CHECK-NEXT: %c = add <8 x i16> %a, %a define <8 x i16> @test1(i8* %p, <8 x i16> %y) { entry: - %q = getelementptr i8* %p, i64 16 + %q = getelementptr i8, i8* %p, i64 16 %a = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) nounwind call void @llvm.arm.neon.vst1.v8i16(i8* %q, <8 x i16> %y, i32 16) %b = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %p, i32 16) nounwind diff --git a/test/Analysis/BasicAA/modref.ll b/test/Analysis/BasicAA/modref.ll index 0d8bf71d42f..39747f933cd 100644 --- a/test/Analysis/BasicAA/modref.ll +++ b/test/Analysis/BasicAA/modref.ll @@ -36,7 +36,7 @@ define i8 @test1() { define i8 @test2(i8* %P) { ; CHECK-LABEL: @test2 - %P2 = getelementptr i8* %P, i32 127 + %P2 = getelementptr i8, i8* %P, i32 127 store i8 1, i8* %P2 ;; Not dead across memset call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i32 0, i1 false) %A = load i8* %P2 @@ -46,7 +46,7 @@ define i8 @test2(i8* %P) { define i8 @test2a(i8* %P) { ; CHECK-LABEL: @test2 - %P2 = getelementptr i8* %P, i32 126 + %P2 = getelementptr i8, i8* %P, i32 126 ;; FIXME: DSE isn't zapping this dead store. store i8 1, i8* %P2 ;; Dead, clobbered by memset. @@ -64,7 +64,7 @@ define void @test3(i8* %P, i8 %X) { ; CHECK-NOT: %Y %Y = add i8 %X, 1 ;; Dead, because the only use (the store) is dead. - %P2 = getelementptr i8* %P, i32 2 + %P2 = getelementptr i8, i8* %P, i32 2 store i8 %Y, i8* %P2 ;; Not read by lifetime.end, should be removed. ; CHECK: store i8 2, i8* %P2 call void @llvm.lifetime.end(i64 1, i8* %P) @@ -78,7 +78,7 @@ define void @test3a(i8* %P, i8 %X) { ; CHECK-LABEL: @test3a %Y = add i8 %X, 1 ;; Dead, because the only use (the store) is dead. - %P2 = getelementptr i8* %P, i32 2 + %P2 = getelementptr i8, i8* %P, i32 2 store i8 %Y, i8* %P2 ; CHECK-NEXT: call void @llvm.lifetime.end call void @llvm.lifetime.end(i64 10, i8* %P) @@ -135,7 +135,7 @@ define i32 @test7() nounwind uwtable ssp { entry: %x = alloca i32, align 4 store i32 0, i32* %x, align 4 - %add.ptr = getelementptr inbounds i32* %x, i64 1 + %add.ptr = getelementptr inbounds i32, i32* %x, i64 1 call void @test7decl(i32* %add.ptr) %tmp = load i32* %x, align 4 ret i32 %tmp diff --git a/test/Analysis/BasicAA/must-and-partial.ll b/test/Analysis/BasicAA/must-and-partial.ll index 58139ff30ec..e8dc1debb78 100644 --- a/test/Analysis/BasicAA/must-and-partial.ll +++ b/test/Analysis/BasicAA/must-and-partial.ll @@ -9,7 +9,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; CHECK: PartialAlias: i16* %bigbase0, i8* %phi define i8 @test0(i8* %base, i1 %x) { entry: - %baseplusone = getelementptr i8* %base, i64 1 + %baseplusone = getelementptr i8, i8* %base, i64 1 br i1 %x, label %red, label %green red: br label %green @@ -27,7 +27,7 @@ green: ; CHECK: PartialAlias: i16* %bigbase1, i8* %sel define i8 @test1(i8* %base, i1 %x) { entry: - %baseplusone = getelementptr i8* %base, i64 1 + %baseplusone = getelementptr i8, i8* %base, i64 1 %sel = select i1 %x, i8* %baseplusone, i8* %base store i8 0, i8* %sel diff --git a/test/Analysis/BasicAA/no-escape-call.ll b/test/Analysis/BasicAA/no-escape-call.ll index b93db6e0ee7..072575cb2b3 100644 --- a/test/Analysis/BasicAA/no-escape-call.ll +++ b/test/Analysis/BasicAA/no-escape-call.ll @@ -8,12 +8,12 @@ define i1 @foo(i32 %i) nounwind { entry: %arr = alloca [10 x i8*] ; <[10 x i8*]*> [#uses=1] %tmp2 = call i8* @getPtr( ) nounwind ; [#uses=2] - %tmp4 = getelementptr [10 x i8*]* %arr, i32 0, i32 %i ; [#uses=2] + %tmp4 = getelementptr [10 x i8*], [10 x i8*]* %arr, i32 0, i32 %i ; [#uses=2] store i8* %tmp2, i8** %tmp4, align 4 - %tmp10 = getelementptr i8* %tmp2, i32 10 ; [#uses=1] + %tmp10 = getelementptr i8, i8* %tmp2, i32 10 ; [#uses=1] store i8 42, i8* %tmp10, align 1 %tmp14 = load i8** %tmp4, align 4 ; [#uses=1] - %tmp16 = getelementptr i8* %tmp14, i32 10 ; [#uses=1] + %tmp16 = getelementptr i8, i8* %tmp14, i32 10 ; [#uses=1] %tmp17 = load i8* %tmp16, align 1 ; [#uses=1] %tmp19 = icmp eq i8 %tmp17, 42 ; [#uses=1] ret i1 %tmp19 diff --git a/test/Analysis/BasicAA/noalias-bugs.ll b/test/Analysis/BasicAA/noalias-bugs.ll index 2bcc14fd939..2ae7660989d 100644 --- a/test/Analysis/BasicAA/noalias-bugs.ll +++ b/test/Analysis/BasicAA/noalias-bugs.ll @@ -12,12 +12,12 @@ target triple = "x86_64-unknown-linux-gnu" define i64 @testcase(%nested * noalias %p1, %nested * noalias %p2, i32 %a, i32 %b) { - %ptr = getelementptr inbounds %nested* %p1, i64 -1, i32 0 - %ptr.64 = getelementptr inbounds %nested.i64* %ptr, i64 0, i32 0 - %ptr2= getelementptr inbounds %nested* %p2, i64 0, i32 0 + %ptr = getelementptr inbounds %nested, %nested* %p1, i64 -1, i32 0 + %ptr.64 = getelementptr inbounds %nested.i64, %nested.i64* %ptr, i64 0, i32 0 + %ptr2= getelementptr inbounds %nested, %nested* %p2, i64 0, i32 0 %cmp = icmp ult i32 %a, %b %either_ptr = select i1 %cmp, %nested.i64* %ptr2, %nested.i64* %ptr - %either_ptr.64 = getelementptr inbounds %nested.i64* %either_ptr, i64 0, i32 0 + %either_ptr.64 = getelementptr inbounds %nested.i64, %nested.i64* %either_ptr, i64 0, i32 0 ; Because either_ptr.64 and ptr.64 can alias (we used to return noalias) ; elimination of the first store is not valid. diff --git a/test/Analysis/BasicAA/noalias-geps.ll b/test/Analysis/BasicAA/noalias-geps.ll index f9ec7134573..cdec9889ca8 100644 --- a/test/Analysis/BasicAA/noalias-geps.ll +++ b/test/Analysis/BasicAA/noalias-geps.ll @@ -5,26 +5,26 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 ; Check that geps with equal base offsets of noalias base pointers stay noalias. define i32 @test(i32* %p, i16 %i) { ; CHECK-LABEL: Function: test: - %pi = getelementptr i32* %p, i32 0 - %pi.next = getelementptr i32* %p, i32 1 + %pi = getelementptr i32, i32* %p, i32 0 + %pi.next = getelementptr i32, i32* %p, i32 1 %b = icmp eq i16 %i, 0 br i1 %b, label %bb1, label %bb2 bb1: - %f = getelementptr i32* %pi, i32 1 - %g = getelementptr i32* %pi.next, i32 1 + %f = getelementptr i32, i32* %pi, i32 1 + %g = getelementptr i32, i32* %pi.next, i32 1 br label %bb3 bb2: - %f2 = getelementptr i32* %pi, i32 1 - %g2 = getelementptr i32* %pi.next, i32 1 + %f2 = getelementptr i32, i32* %pi, i32 1 + %g2 = getelementptr i32, i32* %pi.next, i32 1 br label %bb3 bb3: %ptr_phi = phi i32* [ %f, %bb1 ], [ %f2, %bb2 ] %ptr_phi2 = phi i32* [ %g, %bb1 ], [ %g2, %bb2 ] ; CHECK: NoAlias: i32* %f1, i32* %g1 - %f1 = getelementptr i32* %ptr_phi , i32 1 - %g1 = getelementptr i32* %ptr_phi2 , i32 1 + %f1 = getelementptr i32, i32* %ptr_phi , i32 1 + %g1 = getelementptr i32, i32* %ptr_phi2 , i32 1 ret i32 0 } @@ -32,25 +32,25 @@ ret i32 0 ; Check that geps with equal indices of noalias base pointers stay noalias. define i32 @test2([2 x i32]* %p, i32 %i) { ; CHECK-LABEL: Function: test2: - %pi = getelementptr [2 x i32]* %p, i32 0 - %pi.next = getelementptr [2 x i32]* %p, i32 1 + %pi = getelementptr [2 x i32], [2 x i32]* %p, i32 0 + %pi.next = getelementptr [2 x i32], [2 x i32]* %p, i32 1 %b = icmp eq i32 %i, 0 br i1 %b, label %bb1, label %bb2 bb1: - %f = getelementptr [2 x i32]* %pi, i32 1 - %g = getelementptr [2 x i32]* %pi.next, i32 1 + %f = getelementptr [2 x i32], [2 x i32]* %pi, i32 1 + %g = getelementptr [2 x i32], [2 x i32]* %pi.next, i32 1 br label %bb3 bb2: - %f2 = getelementptr [2 x i32]* %pi, i32 1 - %g2 = getelementptr [2 x i32]* %pi.next, i32 1 + %f2 = getelementptr [2 x i32], [2 x i32]* %pi, i32 1 + %g2 = getelementptr [2 x i32], [2 x i32]* %pi.next, i32 1 br label %bb3 bb3: %ptr_phi = phi [2 x i32]* [ %f, %bb1 ], [ %f2, %bb2 ] %ptr_phi2 = phi [2 x i32]* [ %g, %bb1 ], [ %g2, %bb2 ] ; CHECK: NoAlias: i32* %f1, i32* %g1 - %f1 = getelementptr [2 x i32]* %ptr_phi , i32 1, i32 %i - %g1 = getelementptr [2 x i32]* %ptr_phi2 , i32 1, i32 %i + %f1 = getelementptr [2 x i32], [2 x i32]* %ptr_phi , i32 1, i32 %i + %g1 = getelementptr [2 x i32], [2 x i32]* %ptr_phi2 , i32 1, i32 %i ret i32 0 } diff --git a/test/Analysis/BasicAA/phi-aa.ll b/test/Analysis/BasicAA/phi-aa.ll index c1100f1d36f..1b3341ef109 100644 --- a/test/Analysis/BasicAA/phi-aa.ll +++ b/test/Analysis/BasicAA/phi-aa.ll @@ -54,7 +54,7 @@ codeRepl: for.body: %1 = load i32* %jj7, align 4 %idxprom4 = zext i32 %1 to i64 - %arrayidx5 = getelementptr inbounds [100 x i32]* %oa5, i64 0, i64 %idxprom4 + %arrayidx5 = getelementptr inbounds [100 x i32], [100 x i32]* %oa5, i64 0, i64 %idxprom4 %2 = load i32* %arrayidx5, align 4 %sub6 = sub i32 %2, 6 store i32 %sub6, i32* %arrayidx5, align 4 @@ -63,7 +63,7 @@ for.body: store i32 %3, i32* %arrayidx5, align 4 %sub11 = add i32 %1, -1 %idxprom12 = zext i32 %sub11 to i64 - %arrayidx13 = getelementptr inbounds [100 x i32]* %oa5, i64 0, i64 %idxprom12 + %arrayidx13 = getelementptr inbounds [100 x i32], [100 x i32]* %oa5, i64 0, i64 %idxprom12 call void @inc(i32* %jj7) br label %codeRepl diff --git a/test/Analysis/BasicAA/phi-spec-order.ll b/test/Analysis/BasicAA/phi-spec-order.ll index 4172d0963f3..0d1a6f44ec5 100644 --- a/test/Analysis/BasicAA/phi-spec-order.ll +++ b/test/Analysis/BasicAA/phi-spec-order.ll @@ -23,23 +23,23 @@ for.body4: ; preds = %for.body4, %for.con %lsr.iv = phi i32 [ %lsr.iv.next, %for.body4 ], [ 16000, %for.cond2.preheader ] %lsr.iv46 = bitcast [16000 x double]* %lsr.iv4 to <4 x double>* %lsr.iv12 = bitcast [16000 x double]* %lsr.iv1 to <4 x double>* - %scevgep11 = getelementptr <4 x double>* %lsr.iv46, i64 -2 + %scevgep11 = getelementptr <4 x double>, <4 x double>* %lsr.iv46, i64 -2 %i6 = load <4 x double>* %scevgep11, align 32 %add = fadd <4 x double> %i6, store <4 x double> %add, <4 x double>* %lsr.iv12, align 32 - %scevgep10 = getelementptr <4 x double>* %lsr.iv46, i64 -1 + %scevgep10 = getelementptr <4 x double>, <4 x double>* %lsr.iv46, i64 -1 %i7 = load <4 x double>* %scevgep10, align 32 %add.4 = fadd <4 x double> %i7, - %scevgep9 = getelementptr <4 x double>* %lsr.iv12, i64 1 + %scevgep9 = getelementptr <4 x double>, <4 x double>* %lsr.iv12, i64 1 store <4 x double> %add.4, <4 x double>* %scevgep9, align 32 %i8 = load <4 x double>* %lsr.iv46, align 32 %add.8 = fadd <4 x double> %i8, - %scevgep8 = getelementptr <4 x double>* %lsr.iv12, i64 2 + %scevgep8 = getelementptr <4 x double>, <4 x double>* %lsr.iv12, i64 2 store <4 x double> %add.8, <4 x double>* %scevgep8, align 32 - %scevgep7 = getelementptr <4 x double>* %lsr.iv46, i64 1 + %scevgep7 = getelementptr <4 x double>, <4 x double>* %lsr.iv46, i64 1 %i9 = load <4 x double>* %scevgep7, align 32 %add.12 = fadd <4 x double> %i9, - %scevgep3 = getelementptr <4 x double>* %lsr.iv12, i64 3 + %scevgep3 = getelementptr <4 x double>, <4 x double>* %lsr.iv12, i64 3 store <4 x double> %add.12, <4 x double>* %scevgep3, align 32 ; CHECK: NoAlias:{{[ \t]+}}<4 x double>* %scevgep11, <4 x double>* %scevgep7 @@ -50,9 +50,9 @@ for.body4: ; preds = %for.body4, %for.con ; CHECK: NoAlias:{{[ \t]+}}<4 x double>* %scevgep3, <4 x double>* %scevgep9 %lsr.iv.next = add i32 %lsr.iv, -16 - %scevgep = getelementptr [16000 x double]* %lsr.iv1, i64 0, i64 16 + %scevgep = getelementptr [16000 x double], [16000 x double]* %lsr.iv1, i64 0, i64 16 %i10 = bitcast double* %scevgep to [16000 x double]* - %scevgep5 = getelementptr [16000 x double]* %lsr.iv4, i64 0, i64 16 + %scevgep5 = getelementptr [16000 x double], [16000 x double]* %lsr.iv4, i64 0, i64 16 %i11 = bitcast double* %scevgep5 to [16000 x double]* %exitcond.15 = icmp eq i32 %lsr.iv.next, 0 br i1 %exitcond.15, label %for.end, label %for.body4 diff --git a/test/Analysis/BasicAA/phi-speculation.ll b/test/Analysis/BasicAA/phi-speculation.ll index 5e1e118d985..8965056f95d 100644 --- a/test/Analysis/BasicAA/phi-speculation.ll +++ b/test/Analysis/BasicAA/phi-speculation.ll @@ -8,7 +8,7 @@ target datalayout = ; CHECK: NoAlias: i32* %ptr2_phi, i32* %ptr_phi define i32 @test_noalias_1(i32* %ptr2, i32 %count, i32* %coeff) { entry: - %ptr = getelementptr inbounds i32* %ptr2, i64 1 + %ptr = getelementptr inbounds i32, i32* %ptr2, i64 1 br label %while.body while.body: @@ -24,8 +24,8 @@ while.body: %mul = mul nsw i32 %1, %2 %add = add nsw i32 %mul, %result.09 %tobool = icmp eq i32 %dec, 0 - %ptr_inc = getelementptr inbounds i32* %ptr_phi, i64 1 - %ptr2_inc = getelementptr inbounds i32* %ptr2_phi, i64 1 + %ptr_inc = getelementptr inbounds i32, i32* %ptr_phi, i64 1 + %ptr2_inc = getelementptr inbounds i32, i32* %ptr2_phi, i64 1 br i1 %tobool, label %the_exit, label %while.body the_exit: @@ -37,7 +37,7 @@ the_exit: ; CHECK: NoAlias: i32* %ptr2_phi, i32* %ptr_phi define i32 @test_noalias_2(i32* %ptr2, i32 %count, i32* %coeff) { entry: - %ptr = getelementptr inbounds i32* %ptr2, i64 1 + %ptr = getelementptr inbounds i32, i32* %ptr2, i64 1 br label %outer.while.header outer.while.header: @@ -59,13 +59,13 @@ while.body: %mul = mul nsw i32 %1, %2 %add = add nsw i32 %mul, %result.09 %tobool = icmp eq i32 %dec, 0 - %ptr_inc = getelementptr inbounds i32* %ptr_phi, i64 1 - %ptr2_inc = getelementptr inbounds i32* %ptr2_phi, i64 1 + %ptr_inc = getelementptr inbounds i32, i32* %ptr_phi, i64 1 + %ptr2_inc = getelementptr inbounds i32, i32* %ptr2_phi, i64 1 br i1 %tobool, label %outer.while.backedge, label %while.body outer.while.backedge: - %ptr_inc_outer = getelementptr inbounds i32* %ptr_phi, i64 1 - %ptr2_inc_outer = getelementptr inbounds i32* %ptr2_phi, i64 1 + %ptr_inc_outer = getelementptr inbounds i32, i32* %ptr_phi, i64 1 + %ptr2_inc_outer = getelementptr inbounds i32, i32* %ptr2_phi, i64 1 %dec.outer = add nsw i32 %num.outer, -1 %br.cond = icmp eq i32 %dec.outer, 0 br i1 %br.cond, label %the_exit, label %outer.while.header diff --git a/test/Analysis/BasicAA/pr18573.ll b/test/Analysis/BasicAA/pr18573.ll index 1d2a316b6ff..25f9d94d4dc 100644 --- a/test/Analysis/BasicAA/pr18573.ll +++ b/test/Analysis/BasicAA/pr18573.ll @@ -11,7 +11,7 @@ declare <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float>, i8*, <8 x i32>, define <8 x float> @foo1(i8* noalias readonly %arr.ptr, <8 x i32>* noalias readonly %vix.ptr, i8* noalias %t2.ptr) #1 { allocas: %vix = load <8 x i32>* %vix.ptr, align 4 - %t1.ptr = getelementptr i8* %arr.ptr, i8 4 + %t1.ptr = getelementptr i8, i8* %arr.ptr, i8 4 %v1 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> , i8 1) #2 store i8 1, i8* %t1.ptr, align 4 @@ -32,7 +32,7 @@ allocas: define <8 x float> @foo2(i8* noalias readonly %arr.ptr, <8 x i32>* noalias readonly %vix.ptr, i8* noalias %t2.ptr) #1 { allocas: %vix = load <8 x i32>* %vix.ptr, align 4 - %t1.ptr = getelementptr i8* %arr.ptr, i8 4 + %t1.ptr = getelementptr i8, i8* %arr.ptr, i8 4 %v1 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> , i8 1) #2 store i8 1, i8* %t2.ptr, align 4 diff --git a/test/Analysis/BasicAA/store-promote.ll b/test/Analysis/BasicAA/store-promote.ll index 0db805c3e21..bb4258ff12f 100644 --- a/test/Analysis/BasicAA/store-promote.ll +++ b/test/Analysis/BasicAA/store-promote.ll @@ -36,10 +36,10 @@ define i32 @test2(i1 %c) { Loop: ; preds = %Loop, %0 %AVal = load i32* @A ; [#uses=2] - %C0 = getelementptr [2 x i32]* @C, i64 0, i64 0 ; [#uses=1] + %C0 = getelementptr [2 x i32], [2 x i32]* @C, i64 0, i64 0 ; [#uses=1] store i32 %AVal, i32* %C0 %BVal = load i32* @B ; [#uses=2] - %C1 = getelementptr [2 x i32]* @C, i64 0, i64 1 ; [#uses=1] + %C1 = getelementptr [2 x i32], [2 x i32]* @C, i64 0, i64 1 ; [#uses=1] store i32 %BVal, i32* %C1 br i1 %c, label %Out, label %Loop diff --git a/test/Analysis/BasicAA/struct-geps.ll b/test/Analysis/BasicAA/struct-geps.ll index 3764d48f803..d63c71a3278 100644 --- a/test/Analysis/BasicAA/struct-geps.ll +++ b/test/Analysis/BasicAA/struct-geps.ll @@ -27,9 +27,9 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ; CHECK-DAG: MustAlias: i32* %y, i80* %y_10 define void @test_simple(%struct* %st, i64 %i, i64 %j, i64 %k) { - %x = getelementptr %struct* %st, i64 %i, i32 0 - %y = getelementptr %struct* %st, i64 %j, i32 1 - %z = getelementptr %struct* %st, i64 %k, i32 2 + %x = getelementptr %struct, %struct* %st, i64 %i, i32 0 + %y = getelementptr %struct, %struct* %st, i64 %j, i32 1 + %z = getelementptr %struct, %struct* %st, i64 %k, i32 2 %y_12 = bitcast i32* %y to %struct* %y_10 = bitcast i32* %y to i80* %y_8 = bitcast i32* %y to i64* @@ -59,9 +59,9 @@ define void @test_simple(%struct* %st, i64 %i, i64 %j, i64 %k) { ; CHECK-DAG: MustAlias: i32* %y, i80* %y_10 define void @test_in_array([1 x %struct]* %st, i64 %i, i64 %j, i64 %k, i64 %i1, i64 %j1, i64 %k1) { - %x = getelementptr [1 x %struct]* %st, i64 %i, i64 %i1, i32 0 - %y = getelementptr [1 x %struct]* %st, i64 %j, i64 %j1, i32 1 - %z = getelementptr [1 x %struct]* %st, i64 %k, i64 %k1, i32 2 + %x = getelementptr [1 x %struct], [1 x %struct]* %st, i64 %i, i64 %i1, i32 0 + %y = getelementptr [1 x %struct], [1 x %struct]* %st, i64 %j, i64 %j1, i32 1 + %z = getelementptr [1 x %struct], [1 x %struct]* %st, i64 %k, i64 %k1, i32 2 %y_12 = bitcast i32* %y to %struct* %y_10 = bitcast i32* %y to i80* %y_8 = bitcast i32* %y to i64* @@ -91,9 +91,9 @@ define void @test_in_array([1 x %struct]* %st, i64 %i, i64 %j, i64 %k, i64 %i1, ; CHECK-DAG: MustAlias: i32* %y, i80* %y_10 define void @test_in_3d_array([1 x [1 x [1 x %struct]]]* %st, i64 %i, i64 %j, i64 %k, i64 %i1, i64 %j1, i64 %k1, i64 %i2, i64 %j2, i64 %k2, i64 %i3, i64 %j3, i64 %k3) { - %x = getelementptr [1 x [1 x [1 x %struct]]]* %st, i64 %i, i64 %i1, i64 %i2, i64 %i3, i32 0 - %y = getelementptr [1 x [1 x [1 x %struct]]]* %st, i64 %j, i64 %j1, i64 %j2, i64 %j3, i32 1 - %z = getelementptr [1 x [1 x [1 x %struct]]]* %st, i64 %k, i64 %k1, i64 %k2, i64 %k3, i32 2 + %x = getelementptr [1 x [1 x [1 x %struct]]], [1 x [1 x [1 x %struct]]]* %st, i64 %i, i64 %i1, i64 %i2, i64 %i3, i32 0 + %y = getelementptr [1 x [1 x [1 x %struct]]], [1 x [1 x [1 x %struct]]]* %st, i64 %j, i64 %j1, i64 %j2, i64 %j3, i32 1 + %z = getelementptr [1 x [1 x [1 x %struct]]], [1 x [1 x [1 x %struct]]]* %st, i64 %k, i64 %k1, i64 %k2, i64 %k3, i32 2 %y_12 = bitcast i32* %y to %struct* %y_10 = bitcast i32* %y to i80* %y_8 = bitcast i32* %y to i64* @@ -116,13 +116,13 @@ define void @test_in_3d_array([1 x [1 x [1 x %struct]]]* %st, i64 %i, i64 %j, i6 ; CHECK-DAG: PartialAlias: i32* %y2, i32* %z define void @test_same_underlying_object_same_indices(%struct* %st, i64 %i, i64 %j, i64 %k) { - %st2 = getelementptr %struct* %st, i32 10 - %x2 = getelementptr %struct* %st2, i64 %i, i32 0 - %y2 = getelementptr %struct* %st2, i64 %j, i32 1 - %z2 = getelementptr %struct* %st2, i64 %k, i32 2 - %x = getelementptr %struct* %st, i64 %i, i32 0 - %y = getelementptr %struct* %st, i64 %j, i32 1 - %z = getelementptr %struct* %st, i64 %k, i32 2 + %st2 = getelementptr %struct, %struct* %st, i32 10 + %x2 = getelementptr %struct, %struct* %st2, i64 %i, i32 0 + %y2 = getelementptr %struct, %struct* %st2, i64 %j, i32 1 + %z2 = getelementptr %struct, %struct* %st2, i64 %k, i32 2 + %x = getelementptr %struct, %struct* %st, i64 %i, i32 0 + %y = getelementptr %struct, %struct* %st, i64 %j, i32 1 + %z = getelementptr %struct, %struct* %st, i64 %k, i32 2 ret void } @@ -142,13 +142,13 @@ define void @test_same_underlying_object_same_indices(%struct* %st, i64 %i, i64 ; CHECK-DAG: PartialAlias: i32* %y2, i32* %z define void @test_same_underlying_object_different_indices(%struct* %st, i64 %i1, i64 %j1, i64 %k1, i64 %i2, i64 %k2, i64 %j2) { - %st2 = getelementptr %struct* %st, i32 10 - %x2 = getelementptr %struct* %st2, i64 %i2, i32 0 - %y2 = getelementptr %struct* %st2, i64 %j2, i32 1 - %z2 = getelementptr %struct* %st2, i64 %k2, i32 2 - %x = getelementptr %struct* %st, i64 %i1, i32 0 - %y = getelementptr %struct* %st, i64 %j1, i32 1 - %z = getelementptr %struct* %st, i64 %k1, i32 2 + %st2 = getelementptr %struct, %struct* %st, i32 10 + %x2 = getelementptr %struct, %struct* %st2, i64 %i2, i32 0 + %y2 = getelementptr %struct, %struct* %st2, i64 %j2, i32 1 + %z2 = getelementptr %struct, %struct* %st2, i64 %k2, i32 2 + %x = getelementptr %struct, %struct* %st, i64 %i1, i32 0 + %y = getelementptr %struct, %struct* %st, i64 %j1, i32 1 + %z = getelementptr %struct, %struct* %st, i64 %k1, i32 2 ret void } @@ -158,7 +158,7 @@ define void @test_same_underlying_object_different_indices(%struct* %st, i64 %i1 ; CHECK-LABEL: test_struct_in_array ; CHECK-DAG: MustAlias: i32* %x, i32* %y define void @test_struct_in_array(%struct2* %st, i64 %i, i64 %j, i64 %k) { - %x = getelementptr %struct2* %st, i32 0, i32 1, i32 1, i32 0 - %y = getelementptr %struct2* %st, i32 0, i32 0, i32 1, i32 1 + %x = getelementptr %struct2, %struct2* %st, i32 0, i32 1, i32 1, i32 0 + %y = getelementptr %struct2, %struct2* %st, i32 0, i32 0, i32 1, i32 1 ret void } diff --git a/test/Analysis/BasicAA/underlying-value.ll b/test/Analysis/BasicAA/underlying-value.ll index 0671c825068..b0d22612e98 100644 --- a/test/Analysis/BasicAA/underlying-value.ll +++ b/test/Analysis/BasicAA/underlying-value.ll @@ -14,9 +14,9 @@ for.cond2: ; preds = %for.body5, %for.con br i1 false, label %for.body5, label %for.cond for.body5: ; preds = %for.cond2 - %arrayidx = getelementptr inbounds [2 x i64]* undef, i32 0, i64 0 + %arrayidx = getelementptr inbounds [2 x i64], [2 x i64]* undef, i32 0, i64 0 %tmp7 = load i64* %arrayidx, align 8 - %arrayidx9 = getelementptr inbounds [2 x i64]* undef, i32 0, i64 undef + %arrayidx9 = getelementptr inbounds [2 x i64], [2 x i64]* undef, i32 0, i64 undef %tmp10 = load i64* %arrayidx9, align 8 br label %for.cond2 diff --git a/test/Analysis/BasicAA/unreachable-block.ll b/test/Analysis/BasicAA/unreachable-block.ll index 1ca1e66f894..551d18e3e0f 100644 --- a/test/Analysis/BasicAA/unreachable-block.ll +++ b/test/Analysis/BasicAA/unreachable-block.ll @@ -11,6 +11,6 @@ bb: %t = select i1 undef, i32* %t, i32* undef %p = select i1 undef, i32* %p, i32* %p %q = select i1 undef, i32* undef, i32* %p - %a = getelementptr i8* %a, i32 0 + %a = getelementptr i8, i8* %a, i32 0 unreachable } diff --git a/test/Analysis/BasicAA/zext.ll b/test/Analysis/BasicAA/zext.ll index b59d16cc5f5..bf35a520574 100644 --- a/test/Analysis/BasicAA/zext.ll +++ b/test/Analysis/BasicAA/zext.ll @@ -7,10 +7,10 @@ target triple = "x86_64-unknown-linux-gnu" define void @test_with_zext() { %1 = tail call i8* @malloc(i64 120) - %a = getelementptr inbounds i8* %1, i64 8 - %2 = getelementptr inbounds i8* %1, i64 16 + %a = getelementptr inbounds i8, i8* %1, i64 8 + %2 = getelementptr inbounds i8, i8* %1, i64 16 %3 = zext i32 3 to i64 - %b = getelementptr inbounds i8* %2, i64 %3 + %b = getelementptr inbounds i8, i8* %2, i64 %3 ret void } @@ -19,10 +19,10 @@ define void @test_with_zext() { define void @test_with_lshr(i64 %i) { %1 = tail call i8* @malloc(i64 120) - %a = getelementptr inbounds i8* %1, i64 8 - %2 = getelementptr inbounds i8* %1, i64 16 + %a = getelementptr inbounds i8, i8* %1, i64 8 + %2 = getelementptr inbounds i8, i8* %1, i64 16 %3 = lshr i64 %i, 2 - %b = getelementptr inbounds i8* %2, i64 %3 + %b = getelementptr inbounds i8, i8* %2, i64 %3 ret void } @@ -34,10 +34,10 @@ define void @test_with_a_loop(i8* %mem) { for.loop: %i = phi i32 [ 0, %0 ], [ %i.plus1, %for.loop ] - %a = getelementptr inbounds i8* %mem, i64 8 - %a.plus1 = getelementptr inbounds i8* %mem, i64 16 + %a = getelementptr inbounds i8, i8* %mem, i64 8 + %a.plus1 = getelementptr inbounds i8, i8* %mem, i64 16 %i.64 = zext i32 %i to i64 - %b = getelementptr inbounds i8* %a.plus1, i64 %i.64 + %b = getelementptr inbounds i8, i8* %a.plus1, i64 %i.64 %i.plus1 = add nuw nsw i32 %i, 1 %cmp = icmp eq i32 %i.plus1, 10 br i1 %cmp, label %for.loop.exit, label %for.loop @@ -55,12 +55,12 @@ define void @test_with_varying_base_pointer_in_loop(i8* %mem.orig) { for.loop: %mem = phi i8* [ %mem.orig, %0 ], [ %mem.plus1, %for.loop ] %i = phi i32 [ 0, %0 ], [ %i.plus1, %for.loop ] - %a = getelementptr inbounds i8* %mem, i64 8 - %a.plus1 = getelementptr inbounds i8* %mem, i64 16 + %a = getelementptr inbounds i8, i8* %mem, i64 8 + %a.plus1 = getelementptr inbounds i8, i8* %mem, i64 16 %i.64 = zext i32 %i to i64 - %b = getelementptr inbounds i8* %a.plus1, i64 %i.64 + %b = getelementptr inbounds i8, i8* %a.plus1, i64 %i.64 %i.plus1 = add nuw nsw i32 %i, 1 - %mem.plus1 = getelementptr inbounds i8* %mem, i64 8 + %mem.plus1 = getelementptr inbounds i8, i8* %mem, i64 8 %cmp = icmp eq i32 %i.plus1, 10 br i1 %cmp, label %for.loop.exit, label %for.loop @@ -74,10 +74,10 @@ for.loop.exit: define void @test_sign_extension(i32 %p) { %1 = tail call i8* @malloc(i64 120) %p.64 = zext i32 %p to i64 - %a = getelementptr inbounds i8* %1, i64 %p.64 + %a = getelementptr inbounds i8, i8* %1, i64 %p.64 %p.minus1 = add i32 %p, -1 %p.minus1.64 = zext i32 %p.minus1 to i64 - %b.i8 = getelementptr inbounds i8* %1, i64 %p.minus1.64 + %b.i8 = getelementptr inbounds i8, i8* %1, i64 %p.minus1.64 %b.i64 = bitcast i8* %b.i8 to i64* ret void } @@ -91,13 +91,13 @@ define void @test_fe_tools([8 x i32]* %values) { for.loop: %i = phi i32 [ 0, %reorder ], [ %i.next, %for.loop ] %idxprom = zext i32 %i to i64 - %b = getelementptr inbounds [8 x i32]* %values, i64 0, i64 %idxprom + %b = getelementptr inbounds [8 x i32], [8 x i32]* %values, i64 0, i64 %idxprom %i.next = add nuw nsw i32 %i, 1 %1 = icmp eq i32 %i.next, 10 br i1 %1, label %for.loop.exit, label %for.loop reorder: - %a = getelementptr inbounds [8 x i32]* %values, i64 0, i64 1 + %a = getelementptr inbounds [8 x i32], [8 x i32]* %values, i64 0, i64 1 br label %for.loop for.loop.exit: @@ -123,13 +123,13 @@ define void @test_spec2006() { ;