diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-03-13 18:20:45 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-03-13 18:20:45 +0000 |
commit | f72d05bc7bd83d8a808c2c8662873a0840f39b4d (patch) | |
tree | e791af176cc30d8c637cfeeaab5210b08ea7c1ed /llvm/test/Analysis | |
parent | 84f613532fb33fa0894c5836e7b5619f15f6c321 (diff) | |
download | bcm5719-llvm-f72d05bc7bd83d8a808c2c8662873a0840f39b4d.tar.gz bcm5719-llvm-f72d05bc7bd83d8a808c2c8662873a0840f39b4d.zip |
[opaque pointer type] Add textual IR support for explicit type parameter to gep operator
Similar to gep (r230786) and load (r230794) changes.
Similar migration script can be used to update test cases, which
successfully migrated all of LLVM and Polly, but about 4 test cases
needed manually changes in Clang.
(this script will read the contents of stdin and massage it into stdout
- wrap it in the 'apply.sh' script shown in previous commits + xargs to
apply it over a large set of test cases)
import fileinput
import sys
import re
rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL)
def conv(match):
line = match.group(1)
line += match.group(4)
line += ", "
line += match.group(2)
return line
line = sys.stdin.read()
off = 0
for match in re.finditer(rep, line):
sys.stdout.write(line[off:match.start()])
sys.stdout.write(conv(match))
off = match.end()
sys.stdout.write(line[off:])
llvm-svn: 232184
Diffstat (limited to 'llvm/test/Analysis')
17 files changed, 30 insertions, 30 deletions
diff --git a/llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll b/llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll index 52d10d2e056..957502f2d99 100644 --- a/llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll +++ b/llvm/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll @@ -15,8 +15,8 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" define void @test() { %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 + %F = getelementptr i32, i32* getelementptr (%T, %T* @G, i64 0, i32 0), i64 0 + %X = getelementptr [10 x i8], [10 x i8]* getelementptr (%T, %T* @G, i64 0, i32 1), i64 0, i64 5 ret void } diff --git a/llvm/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll b/llvm/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll index 9e3745737f3..2d33e943937 100644 --- a/llvm/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll +++ b/llvm/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll @@ -8,9 +8,9 @@ define i32 @_Z3fooP1A(%struct.A* %b) { ; CHECK: %tmp7 = load ; CHECK: ret i32 %tmp7 entry: - store i32 1, i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8 + store i32 1, i32* getelementptr (%struct.B, %struct.B* @a, i32 0, i32 0, i32 0), align 8 %tmp4 = getelementptr %struct.A, %struct.A* %b, i32 0, i32 0 ;<i32*> [#uses=1] store i32 0, i32* %tmp4, align 4 - %tmp7 = load i32, i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8 ; <i32> [#uses=1] + %tmp7 = load i32, i32* getelementptr (%struct.B, %struct.B* @a, i32 0, i32 0, i32 0), align 8 ; <i32> [#uses=1] ret i32 %tmp7 } diff --git a/llvm/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll b/llvm/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll index 9b6dbeccd73..7d2cde4864a 100644 --- a/llvm/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll +++ b/llvm/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll @@ -9,7 +9,7 @@ target triple = "i686-pc-linux-gnu" define void @test291() nounwind { entry: - store i32 1138410269, i32* getelementptr ([5 x %struct.S291]* @a291, i32 0, i32 2, i32 1) - %tmp54 = load i32, i32* bitcast (%struct.S291* getelementptr ([5 x %struct.S291]* @a291, i32 0, i32 2) to i32*), align 4 ; <i32> [#uses=0] + store i32 1138410269, i32* getelementptr ([5 x %struct.S291], [5 x %struct.S291]* @a291, i32 0, i32 2, i32 1) + %tmp54 = load i32, i32* bitcast (%struct.S291* getelementptr ([5 x %struct.S291], [5 x %struct.S291]* @a291, i32 0, i32 2) to i32*), align 4 ; <i32> [#uses=0] unreachable } diff --git a/llvm/test/Analysis/BasicAA/aligned-overread.ll b/llvm/test/Analysis/BasicAA/aligned-overread.ll index 47588e71a71..aa0a83e6697 100644 --- a/llvm/test/Analysis/BasicAA/aligned-overread.ll +++ b/llvm/test/Analysis/BasicAA/aligned-overread.ll @@ -9,11 +9,11 @@ target triple = "x86_64-apple-macosx10.8.0" define i32 @main() nounwind uwtable ssp { entry: - %tmp = load i8, i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4 + %tmp = load i8, i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }, { i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4 %tmp1 = or i8 %tmp, -128 - store i8 %tmp1, i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4 + store i8 %tmp1, i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }, { i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4 %tmp2 = load i64, i64* bitcast ({ i8, i8, i8, i8, i8 }* @a to i64*), align 8 - store i8 11, i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4 + store i8 11, i8* getelementptr inbounds ({ i8, i8, i8, i8, i8 }, { i8, i8, i8, i8, i8 }* @a, i64 0, i32 4), align 4 %tmp3 = trunc i64 %tmp2 to i32 ret i32 %tmp3 diff --git a/llvm/test/Analysis/BasicAA/featuretest.ll b/llvm/test/Analysis/BasicAA/featuretest.ll index 97e97f562cd..c621d0e3e84 100644 --- a/llvm/test/Analysis/BasicAA/featuretest.ll +++ b/llvm/test/Analysis/BasicAA/featuretest.ll @@ -97,7 +97,7 @@ define i32 @constexpr_test() { call void @external(i32* %X) %Y = load i32, i32* %X - store i32 5, i32* getelementptr ({ i32 }* @Global, i64 0, i32 0) + store i32 5, i32* getelementptr ({ i32 }, { i32 }* @Global, i64 0, i32 0) %REMOVE = load i32, i32* %X %retval = sub i32 %Y, %REMOVE ret i32 %retval diff --git a/llvm/test/Analysis/BasicAA/phi-spec-order.ll b/llvm/test/Analysis/BasicAA/phi-spec-order.ll index 30aff8c5a48..b326dc36006 100644 --- a/llvm/test/Analysis/BasicAA/phi-spec-order.ll +++ b/llvm/test/Analysis/BasicAA/phi-spec-order.ll @@ -14,7 +14,7 @@ for.cond2.preheader: ; preds = %for.end, %entry br label %for.body4 for.body4: ; preds = %for.body4, %for.cond2.preheader - %lsr.iv4 = phi [16000 x double]* [ %i11, %for.body4 ], [ bitcast (double* getelementptr inbounds ([16000 x double]* @Y, i64 0, i64 8) + %lsr.iv4 = phi [16000 x double]* [ %i11, %for.body4 ], [ bitcast (double* getelementptr inbounds ([16000 x double], [16000 x double]* @Y, i64 0, i64 8) to [16000 x double]*), %for.cond2.preheader ] %lsr.iv1 = phi [16000 x double]* [ %i10, %for.body4 ], [ @X, %for.cond2.preheader ] diff --git a/llvm/test/Analysis/CFLAliasAnalysis/asm-global-bugfix.ll b/llvm/test/Analysis/CFLAliasAnalysis/asm-global-bugfix.ll index 1cd19644d5c..ec2de54e3ee 100644 --- a/llvm/test/Analysis/CFLAliasAnalysis/asm-global-bugfix.ll +++ b/llvm/test/Analysis/CFLAliasAnalysis/asm-global-bugfix.ll @@ -11,6 +11,6 @@ define void @test_no_crash() #0 { entry: call i8* asm "nop", "=r,r"( - i8* getelementptr inbounds ([1 x i8]* @G, i64 0, i64 0)) + i8* getelementptr inbounds ([1 x i8], [1 x i8]* @G, i64 0, i64 0)) ret void } diff --git a/llvm/test/Analysis/CFLAliasAnalysis/const-expr-gep.ll b/llvm/test/Analysis/CFLAliasAnalysis/const-expr-gep.ll index 8c0ad184f16..c7ff407db2f 100644 --- a/llvm/test/Analysis/CFLAliasAnalysis/const-expr-gep.ll +++ b/llvm/test/Analysis/CFLAliasAnalysis/const-expr-gep.ll @@ -19,8 +19,8 @@ ; CHECK: MayAlias: i32* %F, i8* %X define void @test() { %D = getelementptr %T, %T* @G, i64 0, i32 0 - %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 + %F = getelementptr i32, i32* getelementptr (%T, %T* @G, i64 0, i32 0), i64 0 + %X = getelementptr [10 x i8], [10 x i8]* getelementptr (%T, %T* @G, i64 0, i32 1), i64 0, i64 5 ret void } @@ -30,7 +30,7 @@ define void @test() { ; CHECK: MayAlias: i32* %H, i32* %arg0 ; CHECK: MayAlias: i32* %F, i32* %H define void @simplecheck(i32* %arg0) { - %F = getelementptr i32, i32* getelementptr (%T* @G, i64 0, i32 0), i64 0 + %F = getelementptr i32, i32* getelementptr (%T, %T* @G, i64 0, i32 0), i64 0 %H = getelementptr %T, %T* @G2, i64 0, i32 0 ret void @@ -48,7 +48,7 @@ define void @simplecheck(i32* %arg0) { define void @checkNesting(i32* %arg0) { %A = getelementptr [1 x i32], [1 x i32]* getelementptr - ([1 x [1 x i32]]* getelementptr (%NestedT* @NT, i64 0, i32 0), + ([1 x [1 x i32]], [1 x [1 x i32]]* getelementptr (%NestedT, %NestedT* @NT, i64 0, i32 0), i64 0, i32 0), i64 0, diff --git a/llvm/test/Analysis/DependenceAnalysis/UsefulGEP.ll b/llvm/test/Analysis/DependenceAnalysis/UsefulGEP.ll index 83c43cfca64..cd46a275034 100644 --- a/llvm/test/Analysis/DependenceAnalysis/UsefulGEP.ll +++ b/llvm/test/Analysis/DependenceAnalysis/UsefulGEP.ll @@ -36,7 +36,7 @@ for.body3.preheader: for.body3: %j.011 = phi i32 [ %inc, %for.body3 ], [ 0, %for.body3.preheader ] %0 = load i32, i32* %arrayidx - store i32 %0, i32* getelementptr inbounds (%struct.s* @S, i64 0, i32 0, i64 0, i64 0) + store i32 %0, i32* getelementptr inbounds (%struct.s, %struct.s* @S, i64 0, i32 0, i64 0, i64 0) %inc = add nuw nsw i32 %j.011, 1 %exitcond = icmp eq i32 %inc, %N br i1 %exitcond, label %for.inc4, label %for.body3 diff --git a/llvm/test/Analysis/GlobalsModRef/volatile-instrs.ll b/llvm/test/Analysis/GlobalsModRef/volatile-instrs.ll index df49b4b90f9..a331bf370c0 100644 --- a/llvm/test/Analysis/GlobalsModRef/volatile-instrs.ll +++ b/llvm/test/Analysis/GlobalsModRef/volatile-instrs.ll @@ -22,9 +22,9 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, define i32 @main() nounwind uwtable ssp { main_entry: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (%struct.anon* @b to i8*), i8* bitcast (%struct.anon* @a to i8*), i64 12, i32 4, i1 false) - %0 = load volatile i32, i32* getelementptr inbounds (%struct.anon* @b, i64 0, i32 0), align 4 + %0 = load volatile i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @b, i64 0, i32 0), align 4 store i32 %0, i32* @c, align 4 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (%struct.anon* @b to i8*), i8* bitcast (%struct.anon* @a to i8*), i64 12, i32 4, i1 false) nounwind - %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %0) nounwind + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0) nounwind ret i32 0 } diff --git a/llvm/test/Analysis/LazyCallGraph/basic.ll b/llvm/test/Analysis/LazyCallGraph/basic.ll index d0116021d9c..6e2cb905c37 100644 --- a/llvm/test/Analysis/LazyCallGraph/basic.ll +++ b/llvm/test/Analysis/LazyCallGraph/basic.ll @@ -119,8 +119,8 @@ define void @test2() { ; CHECK-NOT: -> load i8*, i8** bitcast (void ()** @g to i8**) - load i8*, i8** bitcast (void ()** getelementptr ([4 x void ()*]* @g1, i32 0, i32 2) to i8**) - load i8*, i8** bitcast (void ()** getelementptr ({i8, void ()*, i8}* @g2, i32 0, i32 1) to i8**) + load i8*, i8** bitcast (void ()** getelementptr ([4 x void ()*], [4 x void ()*]* @g1, i32 0, i32 2) to i8**) + load i8*, i8** bitcast (void ()** getelementptr ({i8, void ()*, i8}, {i8, void ()*, i8}* @g2, i32 0, i32 1) to i8**) load i8*, i8** bitcast (void ()** @h to i8**) ret void } diff --git a/llvm/test/Analysis/ScalarEvolution/2012-03-26-LoadConstant.ll b/llvm/test/Analysis/ScalarEvolution/2012-03-26-LoadConstant.ll index 3ca552a7dfd..c4a4c3006dd 100644 --- a/llvm/test/Analysis/ScalarEvolution/2012-03-26-LoadConstant.ll +++ b/llvm/test/Analysis/ScalarEvolution/2012-03-26-LoadConstant.ll @@ -25,7 +25,7 @@ for.cond: ; preds = %for.body, %lbl_818 for.body: ; preds = %for.cond %idxprom = sext i32 %0 to i64 - %arrayidx = getelementptr inbounds [0 x i32], [0 x i32]* getelementptr inbounds ([1 x [0 x i32]]* @g_244, i32 0, i64 0), i32 0, i64 %idxprom + %arrayidx = getelementptr inbounds [0 x i32], [0 x i32]* getelementptr inbounds ([1 x [0 x i32]], [1 x [0 x i32]]* @g_244, i32 0, i64 0), i32 0, i64 %idxprom %1 = load i32, i32* %arrayidx, align 1 store i32 %1, i32* @func_21_l_773, align 4 store i32 1, i32* @g_814, align 4 diff --git a/llvm/test/Analysis/ScalarEvolution/max-trip-count.ll b/llvm/test/Analysis/ScalarEvolution/max-trip-count.ll index dde44ba8257..72560c77a8e 100644 --- a/llvm/test/Analysis/ScalarEvolution/max-trip-count.ll +++ b/llvm/test/Analysis/ScalarEvolution/max-trip-count.ll @@ -65,7 +65,7 @@ for.inc: ; preds = %for.body br label %for.cond for.end: ; preds = %for.body, %for.cond - %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %g_4.0) nounwind ; <i32> [#uses=0] + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %g_4.0) nounwind ; <i32> [#uses=0] ret i32 0 } diff --git a/llvm/test/Analysis/ScalarEvolution/pr22179.ll b/llvm/test/Analysis/ScalarEvolution/pr22179.ll index 5dc41920e86..21ed055dc7b 100644 --- a/llvm/test/Analysis/ScalarEvolution/pr22179.ll +++ b/llvm/test/Analysis/ScalarEvolution/pr22179.ll @@ -9,12 +9,12 @@ ; Function Attrs: nounwind ssp uwtable define i32 @main() { ; CHECK-LABEL: Classifying expressions for: @main - store i8 0, i8* getelementptr inbounds (%struct.anon* @a, i64 0, i32 0), align 1 + store i8 0, i8* getelementptr inbounds (%struct.anon, %struct.anon* @a, i64 0, i32 0), align 1 br label %loop loop: %storemerge1 = phi i8 [ 0, %0 ], [ %inc, %loop ] - %m = load volatile i32, i32* getelementptr inbounds (%struct.S* @b, i64 0, i32 0), align 4 + %m = load volatile i32, i32* getelementptr inbounds (%struct.S, %struct.S* @b, i64 0, i32 0), align 4 %inc = add nuw i8 %storemerge1, 1 ; CHECK: %inc = add nuw i8 %storemerge1, 1 ; CHECK-NEXT: --> {1,+,1}<nuw><%loop> @@ -23,6 +23,6 @@ loop: br i1 %exitcond, label %exit, label %loop exit: - store i8 -128, i8* getelementptr inbounds (%struct.anon* @a, i64 0, i32 0), align 1 + store i8 -128, i8* getelementptr inbounds (%struct.anon, %struct.anon* @a, i64 0, i32 0), align 1 ret i32 0 } diff --git a/llvm/test/Analysis/ScalarEvolution/sext-iv-2.ll b/llvm/test/Analysis/ScalarEvolution/sext-iv-2.ll index c9d6e4775ec..8749ff3987f 100644 --- a/llvm/test/Analysis/ScalarEvolution/sext-iv-2.ll +++ b/llvm/test/Analysis/ScalarEvolution/sext-iv-2.ll @@ -56,7 +56,7 @@ bb4.bb5_crit_edge: ; preds = %bb4 br label %bb5 bb5: ; preds = %bb4.bb5_crit_edge, %entry - %tmp12 = load i32, i32* getelementptr ([32 x [256 x i32]]* @table, i64 0, i64 9, i64 132), align 16 ; <i32> [#uses=1] + %tmp12 = load i32, i32* getelementptr ([32 x [256 x i32]], [32 x [256 x i32]]* @table, i64 0, i64 9, i64 132), align 16 ; <i32> [#uses=1] %tmp13 = icmp eq i32 %tmp12, -1116 ; <i1> [#uses=1] br i1 %tmp13, label %bb7, label %bb6 diff --git a/llvm/test/Analysis/ScalarEvolution/zext-signed-addrec.ll b/llvm/test/Analysis/ScalarEvolution/zext-signed-addrec.ll index 9201ffca44e..31ebb3e3efe 100644 --- a/llvm/test/Analysis/ScalarEvolution/zext-signed-addrec.ll +++ b/llvm/test/Analysis/ScalarEvolution/zext-signed-addrec.ll @@ -63,7 +63,7 @@ for.cond.for.end9_crit_edge: ; preds = %for.inc8 for.end9: ; preds = %entry.for.end9_crit_edge, %for.cond.for.end9_crit_edge %3 = phi i32 [ %.pre, %entry.for.end9_crit_edge ], [ %shl, %for.cond.for.end9_crit_edge ] - %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %3) #2 + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3) #2 br label %return return.loopexit.split: ; preds = %for.cond1.preheader.lr.ph diff --git a/llvm/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll b/llvm/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll index 15041642ee0..e78529c07f5 100644 --- a/llvm/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll +++ b/llvm/test/Analysis/TypeBasedAliasAnalysis/PR17620.ll @@ -17,10 +17,10 @@ define %structA** @test(%classA* %this, i32** %p1) #0 align 2 { entry: ; CHECK-LABEL: @test ; CHECK: load i32*, i32** %p1, align 8, !tbaa -; CHECK: load i32*, i32** getelementptr (%classC* null, i32 0, i32 1, i32 0, i32 0), align 8, !tbaa +; CHECK: load i32*, i32** getelementptr (%classC, %classC* null, i32 0, i32 1, i32 0, i32 0), align 8, !tbaa ; CHECK: call void @callee %0 = load i32*, i32** %p1, align 8, !tbaa !1 - %1 = load i32*, i32** getelementptr (%classC* null, i32 0, i32 1, i32 0, i32 0), align 8, !tbaa !5 + %1 = load i32*, i32** getelementptr (%classC, %classC* null, i32 0, i32 1, i32 0, i32 0), align 8, !tbaa !5 call void @callee(i32* %0, i32* %1) unreachable } |