summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/GlobalOpt
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-02-27 19:29:02 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-02-27 19:29:02 +0000
commit79e6c74981f4755ed55b38175d8cd34ec91395b1 (patch)
tree3e3d41d853795c46029a07c3fb78b1e2f7668185 /llvm/test/Transforms/GlobalOpt
parentbad3ff207f68e69f36b9a1f90a29f22341e505bb (diff)
downloadbcm5719-llvm-79e6c74981f4755ed55b38175d8cd34ec91395b1.tar.gz
bcm5719-llvm-79e6c74981f4755ed55b38175d8cd34ec91395b1.zip
[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 llvm-svn: 230786
Diffstat (limited to 'llvm/test/Transforms/GlobalOpt')
-rw-r--r--llvm/test/Transforms/GlobalOpt/2005-09-27-Crash.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/2007-05-13-Crash.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll4
-rw-r--r--llvm/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll4
-rw-r--r--llvm/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll4
-rw-r--r--llvm/test/Transforms/GlobalOpt/2009-11-16-MallocSingleStoreToGlobalVar.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/constantfold-initializers.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/crash.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll4
-rw-r--r--llvm/test/Transforms/GlobalOpt/ctor-list-opt.ll6
-rw-r--r--llvm/test/Transforms/GlobalOpt/deadfunction.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/deadglobal-2.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/globalsra-partial.ll4
-rw-r--r--llvm/test/Transforms/GlobalOpt/globalsra-unknown-index.ll12
-rw-r--r--llvm/test/Transforms/GlobalOpt/heap-sra-1.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/heap-sra-2.ll4
-rw-r--r--llvm/test/Transforms/GlobalOpt/heap-sra-3.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/heap-sra-4.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/heap-sra-phi.ll6
-rw-r--r--llvm/test/Transforms/GlobalOpt/load-store-global.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/malloc-promote-2.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/malloc-promote-3.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/memcpy.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/unnamed-addr.ll2
-rw-r--r--llvm/test/Transforms/GlobalOpt/zeroinitializer-gep-load.ll2
27 files changed, 42 insertions, 42 deletions
diff --git a/llvm/test/Transforms/GlobalOpt/2005-09-27-Crash.ll b/llvm/test/Transforms/GlobalOpt/2005-09-27-Crash.ll
index 43597bfd368..061c88159dd 100644
--- a/llvm/test/Transforms/GlobalOpt/2005-09-27-Crash.ll
+++ b/llvm/test/Transforms/GlobalOpt/2005-09-27-Crash.ll
@@ -8,7 +8,7 @@
define fastcc void @pypy_array_constant() {
block0:
- %tmp.9 = getelementptr %structtype.test* bitcast ({ i32, { i32, [2 x i32] } }* @structinstance.test to %structtype.test*), i32 0, i32 0 ; <i32*> [#uses=0]
+ %tmp.9 = getelementptr %structtype.test, %structtype.test* bitcast ({ i32, { i32, [2 x i32] } }* @structinstance.test to %structtype.test*), i32 0, i32 0 ; <i32*> [#uses=0]
ret void
}
diff --git a/llvm/test/Transforms/GlobalOpt/2007-05-13-Crash.ll b/llvm/test/Transforms/GlobalOpt/2007-05-13-Crash.ll
index 57039093d1e..2b7e7379b26 100644
--- a/llvm/test/Transforms/GlobalOpt/2007-05-13-Crash.ll
+++ b/llvm/test/Transforms/GlobalOpt/2007-05-13-Crash.ll
@@ -46,7 +46,7 @@ entry:
define %struct.__CFDictionary* @_ZN18SFLMutableListItem18GetPrefsDictionaryEv(%struct.SFLMutableListItem* %this) {
entry:
- %tmp4 = getelementptr %struct.SFLMutableListItem* %this, i32 0, i32 0 ; <i16*> [#uses=1]
+ %tmp4 = getelementptr %struct.SFLMutableListItem, %struct.SFLMutableListItem* %this, i32 0, i32 0 ; <i16*> [#uses=1]
%tmp5 = load i16* %tmp4 ; <i16> [#uses=1]
%tmp6 = icmp eq i16 %tmp5, 0 ; <i1> [#uses=1]
br i1 %tmp6, label %cond_next22, label %cond_true
diff --git a/llvm/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll b/llvm/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll
index 442cb921d8a..ede505b907e 100644
--- a/llvm/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll
+++ b/llvm/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll
@@ -9,7 +9,7 @@ target triple = "powerpc-apple-darwin8"
define i8 @func() {
entry:
- %tmp10 = getelementptr [2 x i32]* getelementptr ([6 x [2 x i32]]* @aaui1, i32 0, i32 0), i32 5, i32 1 ; <i32*> [#uses=1]
+ %tmp10 = getelementptr [2 x i32], [2 x i32]* getelementptr ([6 x [2 x i32]]* @aaui1, i32 0, i32 0), i32 5, i32 1 ; <i32*> [#uses=1]
%tmp11 = load i32* %tmp10, align 4 ; <i32> [#uses=1]
%tmp12 = call i32 (...)* @func3( i32* null, i32 0, i32 %tmp11 ) ; <i32> [#uses=0]
ret i8 undef
diff --git a/llvm/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll b/llvm/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll
index 7c07d5d9a23..ec246ac2698 100644
--- a/llvm/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll
+++ b/llvm/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll
@@ -4,13 +4,13 @@
@mm = internal global [16 x [31 x double]] zeroinitializer, align 32
define void @test(i32 %X) {
- %P = getelementptr [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X
+ %P = getelementptr [16 x [31 x double]], [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X
store double 1.0, double* %P
ret void
}
define double @get(i32 %X) {
- %P = getelementptr [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X
+ %P = getelementptr [16 x [31 x double]], [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X
%V = load double* %P
ret double %V
}
diff --git a/llvm/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll b/llvm/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll
index b74e4fcd1ef..6a8e2212825 100644
--- a/llvm/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll
+++ b/llvm/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll
@@ -8,7 +8,7 @@ define void @bar(i32 %Size) nounwind noinline {
entry:
%malloccall = tail call i8* @malloc(i32 trunc (i64 mul (i64 ptrtoint (i32* getelementptr (i32* null, i32 1) to i64), i64 2000000) to i32))
%tmp = bitcast i8* %malloccall to [1000000 x %struct.foo]*
- %.sub = getelementptr [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1]
+ %.sub = getelementptr [1000000 x %struct.foo], [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1]
store %struct.foo* %.sub, %struct.foo** @X, align 4
ret void
}
@@ -23,6 +23,6 @@ bb1.thread:
bb1: ; preds = %bb1, %bb1.thread
%tmp = phi %struct.foo* [ %tmpLD1, %bb1.thread ], [ %tmpLD1, %bb1 ] ; <%struct.foo*> [#uses=1]
- %0 = getelementptr %struct.foo* %tmp, i32 1 ; <%struct.foo*> [#uses=0]
+ %0 = getelementptr %struct.foo, %struct.foo* %tmp, i32 1 ; <%struct.foo*> [#uses=0]
br label %bb1
}
diff --git a/llvm/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll b/llvm/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll
index 613cb7bcef0..b6e9e979d17 100644
--- a/llvm/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll
+++ b/llvm/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll
@@ -8,7 +8,7 @@ define void @bar(i32 %Size) nounwind noinline {
entry:
%malloccall = tail call i8* @malloc(i32 trunc (i64 mul (i64 ptrtoint (i32* getelementptr (i32* null, i32 1) to i64), i64 2000000) to i32))
%tmp = bitcast i8* %malloccall to [1000000 x %struct.foo]*
- %.sub = getelementptr [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1]
+ %.sub = getelementptr [1000000 x %struct.foo], [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1]
store %struct.foo* %.sub, %struct.foo** @X, align 4
ret void
}
diff --git a/llvm/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll b/llvm/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll
index e76c44dbd04..c127b856e61 100644
--- a/llvm/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll
+++ b/llvm/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll
@@ -12,9 +12,9 @@ entry:
br label %bb1
bb: ; preds = %bb1
- %0 = getelementptr %struct.node* %t.0, i64 0, i32 1 ; <i32*> [#uses=1]
+ %0 = getelementptr %struct.node, %struct.node* %t.0, i64 0, i32 1 ; <i32*> [#uses=1]
%1 = load i32* %0, align 4 ; <i32> [#uses=1]
- %2 = getelementptr %struct.node* %t.0, i64 0, i32 0 ; <%struct.node**> [#uses=1]
+ %2 = getelementptr %struct.node, %struct.node* %t.0, i64 0, i32 0 ; <%struct.node**> [#uses=1]
br label %bb1
bb1: ; preds = %bb, %entry
diff --git a/llvm/test/Transforms/GlobalOpt/2009-11-16-MallocSingleStoreToGlobalVar.ll b/llvm/test/Transforms/GlobalOpt/2009-11-16-MallocSingleStoreToGlobalVar.ll
index b73f62ba148..7c5e8e40b1d 100644
--- a/llvm/test/Transforms/GlobalOpt/2009-11-16-MallocSingleStoreToGlobalVar.ll
+++ b/llvm/test/Transforms/GlobalOpt/2009-11-16-MallocSingleStoreToGlobalVar.ll
@@ -22,7 +22,7 @@ define void @test() nounwind ssp {
%5 = bitcast i8* %4 to i64* ; <i64*> [#uses=1]
store i64* %5, i64** @TOP, align 8
%6 = load i64** @TOP, align 8 ; <i64*> [#uses=1]
- %7 = getelementptr inbounds i64* %6, i64 13 ; <i64*> [#uses=1]
+ %7 = getelementptr inbounds i64, i64* %6, i64 13 ; <i64*> [#uses=1]
store i64 0, i64* %7, align 8
ret void
}
diff --git a/llvm/test/Transforms/GlobalOpt/constantfold-initializers.ll b/llvm/test/Transforms/GlobalOpt/constantfold-initializers.ll
index 36de19c1cd8..871bfbfd7f2 100644
--- a/llvm/test/Transforms/GlobalOpt/constantfold-initializers.ll
+++ b/llvm/test/Transforms/GlobalOpt/constantfold-initializers.ll
@@ -36,7 +36,7 @@ entry:
define internal i32 @test2_helper(%closure* %this, i32 %b) {
entry:
- %0 = getelementptr inbounds %closure* %this, i32 0, i32 0
+ %0 = getelementptr inbounds %closure, %closure* %this, i32 0, i32 0
%1 = load i32* %0, align 4
%add = add nsw i32 %1, %b
ret i32 %add
diff --git a/llvm/test/Transforms/GlobalOpt/crash.ll b/llvm/test/Transforms/GlobalOpt/crash.ll
index 80c777ccabc..0bef820dd2f 100644
--- a/llvm/test/Transforms/GlobalOpt/crash.ll
+++ b/llvm/test/Transforms/GlobalOpt/crash.ll
@@ -31,7 +31,7 @@ entry:
unreachable
bb.nph.i:
- %scevgep.i539 = getelementptr i8* %C, i64 4
+ %scevgep.i539 = getelementptr i8, i8* %C, i64 4
unreachable
xx:
diff --git a/llvm/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll b/llvm/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll
index dd86f01924a..0c3ff68a437 100644
--- a/llvm/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll
+++ b/llvm/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll
@@ -16,7 +16,7 @@ target triple = "x86_64-apple-darwin10.0.0"
; arbitrary constant expression, the code generator can't handle it.
define internal void @init1() {
entry:
- %tmp = getelementptr inbounds %struct.foo* @X, i32 0, i32 0
+ %tmp = getelementptr inbounds %struct.foo, %struct.foo* @X, i32 0, i32 0
store i32* inttoptr (i64 sdiv (i64 ptrtoint (i32* @G to i64), i64 ptrtoint (i32* @H to i64)) to i32*), i32** %tmp, align 8
ret void
}
@@ -26,7 +26,7 @@ entry:
; PR11705 - ptrtoint isn't safe in general in global initializers.
define internal void @init2() {
entry:
- %tmp = getelementptr inbounds %struct.bar* @X2, i32 0, i32 0
+ %tmp = getelementptr inbounds %struct.bar, %struct.bar* @X2, i32 0, i32 0
store i128 ptrtoint (i32* @G to i128), i128* %tmp, align 16
ret void
}
diff --git a/llvm/test/Transforms/GlobalOpt/ctor-list-opt.ll b/llvm/test/Transforms/GlobalOpt/ctor-list-opt.ll
index 450bdb83028..f0414727967 100644
--- a/llvm/test/Transforms/GlobalOpt/ctor-list-opt.ll
+++ b/llvm/test/Transforms/GlobalOpt/ctor-list-opt.ll
@@ -58,9 +58,9 @@ define internal void @CTOR4() {
}
define internal void @CTOR5() {
- %X.2p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2]
+ %X.2p = getelementptr inbounds { i32, [2 x i32] }, { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2]
%X.2 = load i32* %X.2p ; <i32> [#uses=1]
- %X.1p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1]
+ %X.1p = getelementptr inbounds { i32, [2 x i32] }, { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1]
store i32 %X.2, i32* %X.1p
store i32 42, i32* %X.2p
ret void
@@ -107,7 +107,7 @@ define i1 @accessor() {
define internal void @CTOR9() {
entry:
%0 = bitcast %struct.B* @GV1 to i8*
- %1 = getelementptr inbounds i8* %0, i64 16
+ %1 = getelementptr inbounds i8, i8* %0, i64 16
%2 = bitcast i8* %1 to %struct.A*
%3 = bitcast %struct.B* @GV1 to i8***
store i8** getelementptr inbounds ([3 x i8*]* @GV2, i64 1, i64 0), i8*** %3
diff --git a/llvm/test/Transforms/GlobalOpt/deadfunction.ll b/llvm/test/Transforms/GlobalOpt/deadfunction.ll
index 5e003c63f77..f9a0e925cef 100644
--- a/llvm/test/Transforms/GlobalOpt/deadfunction.ll
+++ b/llvm/test/Transforms/GlobalOpt/deadfunction.ll
@@ -10,7 +10,7 @@ declare void @bb()
define internal void @test(i32 %n) nounwind noinline {
entry:
%idxprom = sext i32 %n to i64
- %arrayidx = getelementptr inbounds [3 x i8*]* @test.x, i64 0, i64 %idxprom
+ %arrayidx = getelementptr inbounds [3 x i8*], [3 x i8*]* @test.x, i64 0, i64 %idxprom
%0 = load i8** %arrayidx, align 8
indirectbr i8* %0, [label %a, label %b, label %c]
diff --git a/llvm/test/Transforms/GlobalOpt/deadglobal-2.ll b/llvm/test/Transforms/GlobalOpt/deadglobal-2.ll
index 4f818198309..6b8717ee183 100644
--- a/llvm/test/Transforms/GlobalOpt/deadglobal-2.ll
+++ b/llvm/test/Transforms/GlobalOpt/deadglobal-2.ll
@@ -5,7 +5,7 @@
@G = internal global [4 x i32] zeroinitializer
define void @foo(i32 %X) {
- %Ptr = getelementptr [4 x i32]* @G, i32 0, i32 %X
+ %Ptr = getelementptr [4 x i32], [4 x i32]* @G, i32 0, i32 %X
store i32 1, i32* %Ptr
ret void
}
diff --git a/llvm/test/Transforms/GlobalOpt/globalsra-partial.ll b/llvm/test/Transforms/GlobalOpt/globalsra-partial.ll
index 06485b53e0e..df9c72f78f4 100644
--- a/llvm/test/Transforms/GlobalOpt/globalsra-partial.ll
+++ b/llvm/test/Transforms/GlobalOpt/globalsra-partial.ll
@@ -11,13 +11,13 @@ define void @onlystore() {
}
define void @storeinit(i32 %i) {
- %Ptr = getelementptr { i32, [4 x float] }* @G, i32 0, i32 1, i32 %i ; <float*> [#uses=1]
+ %Ptr = getelementptr { i32, [4 x float] }, { i32, [4 x float] }* @G, i32 0, i32 1, i32 %i ; <float*> [#uses=1]
store float 1.000000e+00, float* %Ptr
ret void
}
define float @readval(i32 %i) {
- %Ptr = getelementptr { i32, [4 x float] }* @G, i32 0, i32 1, i32 %i ; <float*> [#uses=1]
+ %Ptr = getelementptr { i32, [4 x float] }, { i32, [4 x float] }* @G, i32 0, i32 1, i32 %i ; <float*> [#uses=1]
%V = load float* %Ptr ; <float> [#uses=1]
ret float %V
}
diff --git a/llvm/test/Transforms/GlobalOpt/globalsra-unknown-index.ll b/llvm/test/Transforms/GlobalOpt/globalsra-unknown-index.ll
index cc655e9a2d1..296b12c14cd 100644
--- a/llvm/test/Transforms/GlobalOpt/globalsra-unknown-index.ll
+++ b/llvm/test/Transforms/GlobalOpt/globalsra-unknown-index.ll
@@ -16,25 +16,25 @@ define void @frob() {
ret void
}
define i32 @borf(i64 %i, i64 %j) {
- %p = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 0
+ %p = getelementptr inbounds [3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 0
%a = load i32* %p
- %q = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 0
+ %q = getelementptr inbounds [3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 0
%b = load i32* %q
%c = add i32 %a, %b
ret i32 %c
}
define i32 @borg(i64 %i, i64 %j) {
- %p = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 1
+ %p = getelementptr inbounds [3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 1
%a = load i32* %p
- %q = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 1
+ %q = getelementptr inbounds [3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 1
%b = load i32* %q
%c = add i32 %a, %b
ret i32 %c
}
define i32 @borh(i64 %i, i64 %j) {
- %p = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 2
+ %p = getelementptr inbounds [3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 2
%a = load i32* %p
- %q = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 2
+ %q = getelementptr inbounds [3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 2
%b = load i32* %q
%c = add i32 %a, %b
ret i32 %c
diff --git a/llvm/test/Transforms/GlobalOpt/heap-sra-1.ll b/llvm/test/Transforms/GlobalOpt/heap-sra-1.ll
index 9d5148f9be6..5388401ba51 100644
--- a/llvm/test/Transforms/GlobalOpt/heap-sra-1.ll
+++ b/llvm/test/Transforms/GlobalOpt/heap-sra-1.ll
@@ -25,7 +25,7 @@ bb1.thread:
bb1: ; preds = %bb1, %bb1.thread
%i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %indvar.next, %bb1 ]
%sum.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %3, %bb1 ]
- %1 = getelementptr %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0
+ %1 = getelementptr %struct.foo, %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0
%2 = load i32* %1, align 4
%3 = add i32 %2, %sum.0.reg2mem.0
%indvar.next = add i32 %i.0.reg2mem.0, 1
diff --git a/llvm/test/Transforms/GlobalOpt/heap-sra-2.ll b/llvm/test/Transforms/GlobalOpt/heap-sra-2.ll
index fa8c36281ee..feeb70956d1 100644
--- a/llvm/test/Transforms/GlobalOpt/heap-sra-2.ll
+++ b/llvm/test/Transforms/GlobalOpt/heap-sra-2.ll
@@ -10,7 +10,7 @@ define void @bar(i32 %Size) nounwind noinline {
entry:
%malloccall = tail call i8* @malloc(i64 8000000) ; <i8*> [#uses=1]
%0 = bitcast i8* %malloccall to [1000000 x %struct.foo]* ; <[1000000 x %struct.foo]*> [#uses=1]
- %.sub = getelementptr [1000000 x %struct.foo]* %0, i32 0, i32 0 ; <%struct.foo*> [#uses=1]
+ %.sub = getelementptr [1000000 x %struct.foo], [1000000 x %struct.foo]* %0, i32 0, i32 0 ; <%struct.foo*> [#uses=1]
store %struct.foo* %.sub, %struct.foo** @X, align 4
ret void
}
@@ -25,7 +25,7 @@ bb1.thread:
bb1: ; preds = %bb1, %bb1.thread
%i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %indvar.next, %bb1 ] ; <i32> [#uses=2]
%sum.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %3, %bb1 ] ; <i32> [#uses=1]
- %1 = getelementptr %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0 ; <i32*> [#uses=1]
+ %1 = getelementptr %struct.foo, %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0 ; <i32*> [#uses=1]
%2 = load i32* %1, align 4 ; <i32> [#uses=1]
%3 = add i32 %2, %sum.0.reg2mem.0 ; <i32> [#uses=2]
%indvar.next = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2]
diff --git a/llvm/test/Transforms/GlobalOpt/heap-sra-3.ll b/llvm/test/Transforms/GlobalOpt/heap-sra-3.ll
index e7a877cda44..4ae9ec0cfad 100644
--- a/llvm/test/Transforms/GlobalOpt/heap-sra-3.ll
+++ b/llvm/test/Transforms/GlobalOpt/heap-sra-3.ll
@@ -26,7 +26,7 @@ bb1.thread:
bb1: ; preds = %bb1, %bb1.thread
%i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %indvar.next, %bb1 ]
%sum.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %3, %bb1 ]
- %1 = getelementptr %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0
+ %1 = getelementptr %struct.foo, %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0
%2 = load i32* %1, align 4
%3 = add i32 %2, %sum.0.reg2mem.0
%indvar.next = add i32 %i.0.reg2mem.0, 1
diff --git a/llvm/test/Transforms/GlobalOpt/heap-sra-4.ll b/llvm/test/Transforms/GlobalOpt/heap-sra-4.ll
index d5a58288e1a..a6e7578d062 100644
--- a/llvm/test/Transforms/GlobalOpt/heap-sra-4.ll
+++ b/llvm/test/Transforms/GlobalOpt/heap-sra-4.ll
@@ -26,7 +26,7 @@ bb1.thread:
bb1: ; preds = %bb1, %bb1.thread
%i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %indvar.next, %bb1 ]
%sum.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %3, %bb1 ]
- %1 = getelementptr %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0
+ %1 = getelementptr %struct.foo, %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0
%2 = load i32* %1, align 4
%3 = add i32 %2, %sum.0.reg2mem.0
%indvar.next = add i32 %i.0.reg2mem.0, 1
diff --git a/llvm/test/Transforms/GlobalOpt/heap-sra-phi.ll b/llvm/test/Transforms/GlobalOpt/heap-sra-phi.ll
index 123ad851f71..9449827ccae 100644
--- a/llvm/test/Transforms/GlobalOpt/heap-sra-phi.ll
+++ b/llvm/test/Transforms/GlobalOpt/heap-sra-phi.ll
@@ -9,7 +9,7 @@ define void @bar(i32 %Size) nounwind noinline {
entry:
%malloccall = tail call i8* @malloc(i64 8000000) ; <i8*> [#uses=1]
%tmp = bitcast i8* %malloccall to [1000000 x %struct.foo]* ; <[1000000 x %struct.foo]*> [#uses=1]
- %.sub = getelementptr [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1]
+ %.sub = getelementptr [1000000 x %struct.foo], [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1]
store %struct.foo* %.sub, %struct.foo** @X, align 4
ret void
}
@@ -25,10 +25,10 @@ bb1: ; preds = %bb1, %bb1.thread
%tmp = phi %struct.foo* [%tmpLD1, %bb1.thread ], [ %tmpLD2, %bb1 ] ; <i32> [#uses=2]
%i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %indvar.next, %bb1 ] ; <i32> [#uses=2]
%sum.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %tmp3, %bb1 ] ; <i32> [#uses=1]
- %tmp1 = getelementptr %struct.foo* %tmp, i32 %i.0.reg2mem.0, i32 0 ; <i32*> [#uses=1]
+ %tmp1 = getelementptr %struct.foo, %struct.foo* %tmp, i32 %i.0.reg2mem.0, i32 0 ; <i32*> [#uses=1]
%tmp2 = load i32* %tmp1, align 4 ; <i32> [#uses=1]
%tmp6 = add i32 %tmp2, %sum.0.reg2mem.0 ; <i32> [#uses=2]
- %tmp4 = getelementptr %struct.foo* %tmp, i32 %i.0.reg2mem.0, i32 1 ; <i32*> [#uses=1]
+ %tmp4 = getelementptr %struct.foo, %struct.foo* %tmp, i32 %i.0.reg2mem.0, i32 1 ; <i32*> [#uses=1]
%tmp5 = load i32 * %tmp4
%tmp3 = add i32 %tmp5, %tmp6
%indvar.next = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2]
diff --git a/llvm/test/Transforms/GlobalOpt/load-store-global.ll b/llvm/test/Transforms/GlobalOpt/load-store-global.ll
index ad7326dc682..cbd3cdbdba7 100644
--- a/llvm/test/Transforms/GlobalOpt/load-store-global.ll
+++ b/llvm/test/Transforms/GlobalOpt/load-store-global.ll
@@ -24,7 +24,7 @@ define i32 @bar() {
; PR13968
define void @qux() nounwind {
%b = bitcast i64** @a to i8*
- %g = getelementptr i64** @a, i32 1
+ %g = getelementptr i64*, i64** @a, i32 1
%cmp = icmp ne i8* null, %b
%cmp2 = icmp eq i8* null, %b
%cmp3 = icmp eq i64** null, %g
diff --git a/llvm/test/Transforms/GlobalOpt/malloc-promote-2.ll b/llvm/test/Transforms/GlobalOpt/malloc-promote-2.ll
index 6cb44812d2b..373a7929fa0 100644
--- a/llvm/test/Transforms/GlobalOpt/malloc-promote-2.ll
+++ b/llvm/test/Transforms/GlobalOpt/malloc-promote-2.ll
@@ -11,7 +11,7 @@ define void @t() {
%P = bitcast i8* %malloccall to i32*
store i32* %P, i32** @G
%GV = load i32** @G
- %GVe = getelementptr i32* %GV, i32 40
+ %GVe = getelementptr i32, i32* %GV, i32 40
store i32 20, i32* %GVe
ret void
}
diff --git a/llvm/test/Transforms/GlobalOpt/malloc-promote-3.ll b/llvm/test/Transforms/GlobalOpt/malloc-promote-3.ll
index d44ee646095..b4e7986df64 100644
--- a/llvm/test/Transforms/GlobalOpt/malloc-promote-3.ll
+++ b/llvm/test/Transforms/GlobalOpt/malloc-promote-3.ll
@@ -10,7 +10,7 @@ define void @t() {
%P = bitcast i8* %malloccall to i32*
store i32* %P, i32** @G
%GV = load i32** @G
- %GVe = getelementptr i32* %GV, i32 40
+ %GVe = getelementptr i32, i32* %GV, i32 40
store i32 20, i32* %GVe
ret void
}
diff --git a/llvm/test/Transforms/GlobalOpt/memcpy.ll b/llvm/test/Transforms/GlobalOpt/memcpy.ll
index dcfe009e330..9cf20366e78 100644
--- a/llvm/test/Transforms/GlobalOpt/memcpy.ll
+++ b/llvm/test/Transforms/GlobalOpt/memcpy.ll
@@ -5,7 +5,7 @@
define void @foo() {
%Blah = alloca [58 x i8]
- %tmp.0 = getelementptr [58 x i8]* %Blah, i32 0, i32 0
+ %tmp.0 = getelementptr [58 x i8], [58 x i8]* %Blah, i32 0, i32 0
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp.0, i8* getelementptr inbounds ([58 x i8]* @G1, i32 0, i32 0), i32 58, i32 1, i1 false)
ret void
}
diff --git a/llvm/test/Transforms/GlobalOpt/unnamed-addr.ll b/llvm/test/Transforms/GlobalOpt/unnamed-addr.ll
index 2ca91e50da2..c2ce0b9ddd9 100644
--- a/llvm/test/Transforms/GlobalOpt/unnamed-addr.ll
+++ b/llvm/test/Transforms/GlobalOpt/unnamed-addr.ll
@@ -24,7 +24,7 @@ define void @set_e(i32 %x) {
define i1 @bah(i64 %i) nounwind readonly optsize ssp {
entry:
- %arrayidx4 = getelementptr inbounds [4 x i8]* @d, i64 0, i64 %i
+ %arrayidx4 = getelementptr inbounds [4 x i8], [4 x i8]* @d, i64 0, i64 %i
%tmp5 = load i8* %arrayidx4, align 1
%array0 = bitcast [4 x i8]* @d to i8*
%tmp6 = load i8* %array0, align 1
diff --git a/llvm/test/Transforms/GlobalOpt/zeroinitializer-gep-load.ll b/llvm/test/Transforms/GlobalOpt/zeroinitializer-gep-load.ll
index d9787232d97..ad16a6485e8 100644
--- a/llvm/test/Transforms/GlobalOpt/zeroinitializer-gep-load.ll
+++ b/llvm/test/Transforms/GlobalOpt/zeroinitializer-gep-load.ll
@@ -3,7 +3,7 @@
@zero = internal global [10 x i32] zeroinitializer
define i32 @test1(i64 %idx) nounwind {
- %arrayidx = getelementptr inbounds [10 x i32]* @zero, i64 0, i64 %idx
+ %arrayidx = getelementptr inbounds [10 x i32], [10 x i32]* @zero, i64 0, i64 %idx
%l = load i32* %arrayidx
ret i32 %l
; CHECK-LABEL: @test1(
OpenPOWER on IntegriCloud