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 | 5a70dd1d8286faa4713b60da7621094d892e2ffc (patch) | |
tree | 2715144202f3d14b8835880f3ebd9b53cbb0e6a2 /test/Analysis/BasicAA | |
parent | 300c79d840829969fba278ee59152fbfbd5c8844 (diff) |
[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:])
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232184 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/BasicAA')
-rw-r--r-- | test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll | 4 | ||||
-rw-r--r-- | test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll | 4 | ||||
-rw-r--r-- | test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll | 4 | ||||
-rw-r--r-- | test/Analysis/BasicAA/aligned-overread.ll | 6 | ||||
-rw-r--r-- | test/Analysis/BasicAA/featuretest.ll | 2 | ||||
-rw-r--r-- | test/Analysis/BasicAA/phi-spec-order.ll | 2 |
6 files changed, 11 insertions, 11 deletions
diff --git a/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll b/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll index 52d10d2e056..957502f2d99 100644 --- a/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll +++ b/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/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll b/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll index 9e3745737f3..2d33e943937 100644 --- a/test/Analysis/BasicAA/2007-10-24-ArgumentsGlobals.ll +++ b/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/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll b/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll index 9b6dbeccd73..7d2cde4864a 100644 --- a/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll +++ b/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/test/Analysis/BasicAA/aligned-overread.ll b/test/Analysis/BasicAA/aligned-overread.ll index 47588e71a71..aa0a83e6697 100644 --- a/test/Analysis/BasicAA/aligned-overread.ll +++ b/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/test/Analysis/BasicAA/featuretest.ll b/test/Analysis/BasicAA/featuretest.ll index 97e97f562cd..c621d0e3e84 100644 --- a/test/Analysis/BasicAA/featuretest.ll +++ b/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/test/Analysis/BasicAA/phi-spec-order.ll b/test/Analysis/BasicAA/phi-spec-order.ll index 30aff8c5a48..b326dc36006 100644 --- a/test/Analysis/BasicAA/phi-spec-order.ll +++ b/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 ] |