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/CodeGen/XCore | |
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/CodeGen/XCore')
-rw-r--r-- | llvm/test/CodeGen/XCore/2011-01-31-DAGCombineBug.ll | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/XCore/codemodel.ll | 14 | ||||
-rw-r--r-- | llvm/test/CodeGen/XCore/threads.ll | 16 | ||||
-rw-r--r-- | llvm/test/CodeGen/XCore/unaligned_load.ll | 2 |
4 files changed, 17 insertions, 17 deletions
diff --git a/llvm/test/CodeGen/XCore/2011-01-31-DAGCombineBug.ll b/llvm/test/CodeGen/XCore/2011-01-31-DAGCombineBug.ll index 92391de8fa3..40c9654371f 100644 --- a/llvm/test/CodeGen/XCore/2011-01-31-DAGCombineBug.ll +++ b/llvm/test/CodeGen/XCore/2011-01-31-DAGCombineBug.ll @@ -5,6 +5,6 @@ define i32 @test_entry() nounwind { entry: - %0 = load i32, i32* getelementptr inbounds (%struct.st* @x, i32 0, i32 3), align 2 + %0 = load i32, i32* getelementptr inbounds (%struct.st, %struct.st* @x, i32 0, i32 3), align 2 ret i32 %0 } diff --git a/llvm/test/CodeGen/XCore/codemodel.ll b/llvm/test/CodeGen/XCore/codemodel.ll index 706c38075ab..4e637995c5a 100644 --- a/llvm/test/CodeGen/XCore/codemodel.ll +++ b/llvm/test/CodeGen/XCore/codemodel.ll @@ -101,17 +101,17 @@ entry: %2 = getelementptr inbounds i32, i32* %i, i32 16384 %3 = load i32, i32* %2 %4 = add nsw i32 %1, %3 - %5 = load i32, i32* getelementptr inbounds ([100 x i32]* @l, i32 0, i32 0) + %5 = load i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @l, i32 0, i32 0) %6 = add nsw i32 %4, %5 - %7 = load i32, i32* getelementptr inbounds ([100 x i32]* @l, i32 0, i32 1) + %7 = load i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @l, i32 0, i32 1) %8 = add nsw i32 %6, %7 - %9 = load i32, i32* getelementptr inbounds ([100 x i32]* @l, i32 0, i32 98) + %9 = load i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @l, i32 0, i32 98) %10 = add nsw i32 %8, %9 - %11 = load i32, i32* getelementptr inbounds ([100 x i32]* @l, i32 0, i32 99) + %11 = load i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @l, i32 0, i32 99) %12 = add nsw i32 %10, %11 - %13 = load i32, i32* getelementptr inbounds ([10 x i32]* @s, i32 0, i32 0) + %13 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @s, i32 0, i32 0) %14 = add nsw i32 %12, %13 - %15 = load i32, i32* getelementptr inbounds ([10 x i32]* @s, i32 0, i32 9) + %15 = load i32, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @s, i32 0, i32 9) %16 = add nsw i32 %14, %15 ret i32 %16 } @@ -132,7 +132,7 @@ entry: @NoSize = external global [0 x i32] define i32 @UnknownSize() nounwind { entry: - %0 = load i32, i32* getelementptr inbounds ([0 x i32]* @NoSize, i32 0, i32 10) + %0 = load i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @NoSize, i32 0, i32 10) ret i32 %0 } diff --git a/llvm/test/CodeGen/XCore/threads.ll b/llvm/test/CodeGen/XCore/threads.ll index c50da1d5934..0c25314295d 100644 --- a/llvm/test/CodeGen/XCore/threads.ll +++ b/llvm/test/CodeGen/XCore/threads.ll @@ -78,7 +78,7 @@ define i32* @f_tl() { ; CHECK: ldc [[R2:r[0-9]]], 12 ; r0 = id*12 + 8 + &tl ; CHECK: lmul {{r[0-9]}}, r0, r11, [[R2]], [[R0]], [[R1]] - ret i32* getelementptr inbounds ([3 x i32]* @tl, i32 0, i32 2) + ret i32* getelementptr inbounds ([3 x i32], [3 x i32]* @tl, i32 0, i32 2) } define i32* @f_tle() { @@ -88,7 +88,7 @@ define i32* @f_tle() { ; CHECK: ldaw [[R1:r[0-9]]], dp[tle] ; r0 = &tl + id*8 ; CHECK: add r0, [[R1]], [[R0]] - ret i32* getelementptr inbounds ([2 x i32]* @tle, i32 0, i32 0) + ret i32* getelementptr inbounds ([2 x i32], [2 x i32]* @tle, i32 0, i32 0) } define i32 @f_tlExpr () { @@ -99,8 +99,8 @@ define i32 @f_tlExpr () { ; CHECK: add [[R2:r[0-9]]], [[R1]], [[R0]] ; CHECK: add r0, [[R2]], [[R2]] ret i32 add( - i32 ptrtoint( i32* getelementptr inbounds ([2 x i32]* @tle, i32 0, i32 0) to i32), - i32 ptrtoint( i32* getelementptr inbounds ([2 x i32]* @tle, i32 0, i32 0) to i32)) + i32 ptrtoint( i32* getelementptr inbounds ([2 x i32], [2 x i32]* @tle, i32 0, i32 0) to i32), + i32 ptrtoint( i32* getelementptr inbounds ([2 x i32], [2 x i32]* @tle, i32 0, i32 0) to i32)) } define void @phiNode1() { @@ -113,8 +113,8 @@ define void @phiNode1() { entry: br label %ConstantExpPhiNode ConstantExpPhiNode: - %ptr = phi i32* [ getelementptr inbounds ([3 x i32]* @tl, i32 0, i32 0), %entry ], - [ getelementptr inbounds ([3 x i32]* @tl, i32 0, i32 0), %ConstantExpPhiNode ] + %ptr = phi i32* [ getelementptr inbounds ([3 x i32], [3 x i32]* @tl, i32 0, i32 0), %entry ], + [ getelementptr inbounds ([3 x i32], [3 x i32]* @tl, i32 0, i32 0), %ConstantExpPhiNode ] br label %ConstantExpPhiNode exit: ret void @@ -134,8 +134,8 @@ define void @phiNode2( i1 %bool) { entry: br i1 %bool, label %ConstantExpPhiNode, label %exit ConstantExpPhiNode: - %ptr = phi i32* [ getelementptr inbounds ([3 x i32]* @tl, i32 0, i32 0), %entry ], - [ getelementptr inbounds ([3 x i32]* @tl, i32 0, i32 0), %ConstantExpPhiNode ] + %ptr = phi i32* [ getelementptr inbounds ([3 x i32], [3 x i32]* @tl, i32 0, i32 0), %entry ], + [ getelementptr inbounds ([3 x i32], [3 x i32]* @tl, i32 0, i32 0), %ConstantExpPhiNode ] br label %ConstantExpPhiNode exit: ret void diff --git a/llvm/test/CodeGen/XCore/unaligned_load.ll b/llvm/test/CodeGen/XCore/unaligned_load.ll index 4bec151acae..325da8f4432 100644 --- a/llvm/test/CodeGen/XCore/unaligned_load.ll +++ b/llvm/test/CodeGen/XCore/unaligned_load.ll @@ -29,6 +29,6 @@ entry: ; CHECK: or define i32 @align3() nounwind { entry: - %0 = load i32, i32* bitcast (i8* getelementptr ([5 x i8]* @a, i32 0, i32 1) to i32*), align 1 + %0 = load i32, i32* bitcast (i8* getelementptr ([5 x i8], [5 x i8]* @a, i32 0, i32 1) to i32*), align 1 ret i32 %0 } |