summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/SystemZ/fp-cmp-01.ll
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/CodeGen/SystemZ/fp-cmp-01.ll
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/CodeGen/SystemZ/fp-cmp-01.ll')
-rw-r--r--llvm/test/CodeGen/SystemZ/fp-cmp-01.ll30
1 files changed, 15 insertions, 15 deletions
diff --git a/llvm/test/CodeGen/SystemZ/fp-cmp-01.ll b/llvm/test/CodeGen/SystemZ/fp-cmp-01.ll
index d7c0cce9c2a..09e531fae8d 100644
--- a/llvm/test/CodeGen/SystemZ/fp-cmp-01.ll
+++ b/llvm/test/CodeGen/SystemZ/fp-cmp-01.ll
@@ -37,7 +37,7 @@ define i64 @f3(i64 %a, i64 %b, float %f1, float *%base) {
; CHECK-NEXT: je
; CHECK: lgr %r2, %r3
; CHECK: br %r14
- %ptr = getelementptr float *%base, i64 1023
+ %ptr = getelementptr float, float *%base, i64 1023
%f2 = load float *%ptr
%cond = fcmp oeq float %f1, %f2
%res = select i1 %cond, i64 %a, i64 %b
@@ -53,7 +53,7 @@ define i64 @f4(i64 %a, i64 %b, float %f1, float *%base) {
; CHECK-NEXT: je
; CHECK: lgr %r2, %r3
; CHECK: br %r14
- %ptr = getelementptr float *%base, i64 1024
+ %ptr = getelementptr float, float *%base, i64 1024
%f2 = load float *%ptr
%cond = fcmp oeq float %f1, %f2
%res = select i1 %cond, i64 %a, i64 %b
@@ -68,7 +68,7 @@ define i64 @f5(i64 %a, i64 %b, float %f1, float *%base) {
; CHECK-NEXT: je
; CHECK: lgr %r2, %r3
; CHECK: br %r14
- %ptr = getelementptr float *%base, i64 -1
+ %ptr = getelementptr float, float *%base, i64 -1
%f2 = load float *%ptr
%cond = fcmp oeq float %f1, %f2
%res = select i1 %cond, i64 %a, i64 %b
@@ -83,8 +83,8 @@ define i64 @f6(i64 %a, i64 %b, float %f1, float *%base, i64 %index) {
; CHECK-NEXT: je
; CHECK: lgr %r2, %r3
; CHECK: br %r14
- %ptr1 = getelementptr float *%base, i64 %index
- %ptr2 = getelementptr float *%ptr1, i64 100
+ %ptr1 = getelementptr float, float *%base, i64 %index
+ %ptr2 = getelementptr float, float *%ptr1, i64 100
%f2 = load float *%ptr2
%cond = fcmp oeq float %f1, %f2
%res = select i1 %cond, i64 %a, i64 %b
@@ -97,16 +97,16 @@ define float @f7(float *%ptr0) {
; CHECK: brasl %r14, foo@PLT
; CHECK: ceb {{%f[0-9]+}}, 16{{[04]}}(%r15)
; CHECK: br %r14
- %ptr1 = getelementptr float *%ptr0, i64 2
- %ptr2 = getelementptr float *%ptr0, i64 4
- %ptr3 = getelementptr float *%ptr0, i64 6
- %ptr4 = getelementptr float *%ptr0, i64 8
- %ptr5 = getelementptr float *%ptr0, i64 10
- %ptr6 = getelementptr float *%ptr0, i64 12
- %ptr7 = getelementptr float *%ptr0, i64 14
- %ptr8 = getelementptr float *%ptr0, i64 16
- %ptr9 = getelementptr float *%ptr0, i64 18
- %ptr10 = getelementptr float *%ptr0, i64 20
+ %ptr1 = getelementptr float, float *%ptr0, i64 2
+ %ptr2 = getelementptr float, float *%ptr0, i64 4
+ %ptr3 = getelementptr float, float *%ptr0, i64 6
+ %ptr4 = getelementptr float, float *%ptr0, i64 8
+ %ptr5 = getelementptr float, float *%ptr0, i64 10
+ %ptr6 = getelementptr float, float *%ptr0, i64 12
+ %ptr7 = getelementptr float, float *%ptr0, i64 14
+ %ptr8 = getelementptr float, float *%ptr0, i64 16
+ %ptr9 = getelementptr float, float *%ptr0, i64 18
+ %ptr10 = getelementptr float, float *%ptr0, i64 20
%val0 = load float *%ptr0
%val1 = load float *%ptr1
OpenPOWER on IntegriCloud