2014-05-24 12:50:23 +00:00
|
|
|
; RUN: llc -verify-machineinstrs -o - %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
|
|
|
|
; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -mattr=-fp-armv8 | FileCheck --check-prefix=CHECK-NOFP %s
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
@var_8bit = global i8 0
|
|
|
|
@var_16bit = global i16 0
|
|
|
|
@var_32bit = global i32 0
|
|
|
|
@var_64bit = global i64 0
|
|
|
|
|
|
|
|
@var_float = global float 0.0
|
|
|
|
@var_double = global double 0.0
|
|
|
|
|
|
|
|
define void @ldst_8bit() {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: ldst_8bit:
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; No architectural support for loads to 16-bit or 8-bit since we
|
|
|
|
; promote i8 during lowering.
|
|
|
|
|
|
|
|
; match a sign-extending load 8-bit -> 32-bit
|
2015-02-27 21:17:42 +00:00
|
|
|
%val8_sext32 = load volatile i8, i8* @var_8bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val32_signed = sext i8 %val8_sext32 to i32
|
|
|
|
store volatile i32 %val32_signed, i32* @var_32bit
|
|
|
|
; CHECK: adrp {{x[0-9]+}}, var_8bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldrsb {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_8bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; match a zero-extending load volatile 8-bit -> 32-bit
|
2015-02-27 21:17:42 +00:00
|
|
|
%val8_zext32 = load volatile i8, i8* @var_8bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val32_unsigned = zext i8 %val8_zext32 to i32
|
|
|
|
store volatile i32 %val32_unsigned, i32* @var_32bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldrb {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_8bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; match an any-extending load volatile 8-bit -> 32-bit
|
2015-02-27 21:17:42 +00:00
|
|
|
%val8_anyext = load volatile i8, i8* @var_8bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%newval8 = add i8 %val8_anyext, 1
|
|
|
|
store volatile i8 %newval8, i8* @var_8bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldrb {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_8bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; match a sign-extending load volatile 8-bit -> 64-bit
|
2015-02-27 21:17:42 +00:00
|
|
|
%val8_sext64 = load volatile i8, i8* @var_8bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val64_signed = sext i8 %val8_sext64 to i64
|
|
|
|
store volatile i64 %val64_signed, i64* @var_64bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldrsb {{x[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_8bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; match a zero-extending load volatile 8-bit -> 64-bit.
|
|
|
|
; This uses the fact that ldrb w0, [x0] will zero out the high 32-bits
|
|
|
|
; of x0 so it's identical to load volatileing to 32-bits.
|
2015-02-27 21:17:42 +00:00
|
|
|
%val8_zext64 = load volatile i8, i8* @var_8bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val64_unsigned = zext i8 %val8_zext64 to i64
|
|
|
|
store volatile i64 %val64_unsigned, i64* @var_64bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldrb {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_8bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; truncating store volatile 32-bits to 8-bits
|
2015-02-27 21:17:42 +00:00
|
|
|
%val32 = load volatile i32, i32* @var_32bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val8_trunc32 = trunc i32 %val32 to i8
|
|
|
|
store volatile i8 %val8_trunc32, i8* @var_8bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: strb {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_8bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; truncating store volatile 64-bits to 8-bits
|
2015-02-27 21:17:42 +00:00
|
|
|
%val64 = load volatile i64, i64* @var_64bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val8_trunc64 = trunc i64 %val64 to i8
|
|
|
|
store volatile i8 %val8_trunc64, i8* @var_8bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: strb {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_8bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @ldst_16bit() {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: ldst_16bit:
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; No architectural support for load volatiles to 16-bit promote i16 during
|
|
|
|
; lowering.
|
|
|
|
|
|
|
|
; match a sign-extending load volatile 16-bit -> 32-bit
|
2015-02-27 21:17:42 +00:00
|
|
|
%val16_sext32 = load volatile i16, i16* @var_16bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val32_signed = sext i16 %val16_sext32 to i32
|
|
|
|
store volatile i32 %val32_signed, i32* @var_32bit
|
|
|
|
; CHECK: adrp {{x[0-9]+}}, var_16bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldrsh {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_16bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; match a zero-extending load volatile 16-bit -> 32-bit
|
2015-02-27 21:17:42 +00:00
|
|
|
%val16_zext32 = load volatile i16, i16* @var_16bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val32_unsigned = zext i16 %val16_zext32 to i32
|
|
|
|
store volatile i32 %val32_unsigned, i32* @var_32bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldrh {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_16bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; match an any-extending load volatile 16-bit -> 32-bit
|
2015-02-27 21:17:42 +00:00
|
|
|
%val16_anyext = load volatile i16, i16* @var_16bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%newval16 = add i16 %val16_anyext, 1
|
|
|
|
store volatile i16 %newval16, i16* @var_16bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldrh {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_16bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; match a sign-extending load volatile 16-bit -> 64-bit
|
2015-02-27 21:17:42 +00:00
|
|
|
%val16_sext64 = load volatile i16, i16* @var_16bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val64_signed = sext i16 %val16_sext64 to i64
|
|
|
|
store volatile i64 %val64_signed, i64* @var_64bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldrsh {{x[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_16bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; match a zero-extending load volatile 16-bit -> 64-bit.
|
|
|
|
; This uses the fact that ldrb w0, [x0] will zero out the high 32-bits
|
|
|
|
; of x0 so it's identical to load volatileing to 32-bits.
|
2015-02-27 21:17:42 +00:00
|
|
|
%val16_zext64 = load volatile i16, i16* @var_16bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val64_unsigned = zext i16 %val16_zext64 to i64
|
|
|
|
store volatile i64 %val64_unsigned, i64* @var_64bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldrh {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_16bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; truncating store volatile 32-bits to 16-bits
|
2015-02-27 21:17:42 +00:00
|
|
|
%val32 = load volatile i32, i32* @var_32bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val16_trunc32 = trunc i32 %val32 to i16
|
|
|
|
store volatile i16 %val16_trunc32, i16* @var_16bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: strh {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_16bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; truncating store volatile 64-bits to 16-bits
|
2015-02-27 21:17:42 +00:00
|
|
|
%val64 = load volatile i64, i64* @var_64bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val16_trunc64 = trunc i64 %val64 to i16
|
|
|
|
store volatile i16 %val16_trunc64, i16* @var_16bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: strh {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_16bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @ldst_32bit() {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: ldst_32bit:
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; Straight 32-bit load/store
|
2015-02-27 21:17:42 +00:00
|
|
|
%val32_noext = load volatile i32, i32* @var_32bit
|
2013-01-31 12:12:40 +00:00
|
|
|
store volatile i32 %val32_noext, i32* @var_32bit
|
|
|
|
; CHECK: adrp {{x[0-9]+}}, var_32bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldr {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_32bit]
|
|
|
|
; CHECK: str {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_32bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; Zero-extension to 64-bits
|
2015-02-27 21:17:42 +00:00
|
|
|
%val32_zext = load volatile i32, i32* @var_32bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val64_unsigned = zext i32 %val32_zext to i64
|
|
|
|
store volatile i64 %val64_unsigned, i64* @var_64bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldr {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_32bit]
|
|
|
|
; CHECK: str {{x[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_64bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; Sign-extension to 64-bits
|
2015-02-27 21:17:42 +00:00
|
|
|
%val32_sext = load volatile i32, i32* @var_32bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val64_signed = sext i32 %val32_sext to i64
|
|
|
|
store volatile i64 %val64_signed, i64* @var_64bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldrsw {{x[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_32bit]
|
|
|
|
; CHECK: str {{x[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_64bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; Truncation from 64-bits
|
2015-02-27 21:17:42 +00:00
|
|
|
%val64_trunc = load volatile i64, i64* @var_64bit
|
2013-01-31 12:12:40 +00:00
|
|
|
%val32_trunc = trunc i64 %val64_trunc to i32
|
|
|
|
store volatile i32 %val32_trunc, i32* @var_32bit
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldr {{x[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_64bit]
|
|
|
|
; CHECK: str {{w[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_32bit]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
@arr8 = global i8* null
|
|
|
|
@arr16 = global i16* null
|
|
|
|
@arr32 = global i32* null
|
|
|
|
@arr64 = global i64* null
|
|
|
|
|
|
|
|
; Now check that our selection copes with accesses more complex than a
|
|
|
|
; single symbol. Permitted offsets should be folded into the loads and
|
|
|
|
; stores. Since all forms use the same Operand it's only necessary to
|
|
|
|
; check the various access-sizes involved.
|
|
|
|
|
|
|
|
define void @ldst_complex_offsets() {
|
|
|
|
; CHECK: ldst_complex_offsets
|
2015-02-27 21:17:42 +00:00
|
|
|
%arr8_addr = load volatile i8*, i8** @arr8
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK: adrp {{x[0-9]+}}, arr8
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldr {{x[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:arr8]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%arr8_sub1_addr = getelementptr i8, i8* %arr8_addr, i64 1
|
2015-02-27 21:17:42 +00:00
|
|
|
%arr8_sub1 = load volatile i8, i8* %arr8_sub1_addr
|
2013-01-31 12:12:40 +00:00
|
|
|
store volatile i8 %arr8_sub1, i8* @var_8bit
|
|
|
|
; CHECK: ldrb {{w[0-9]+}}, [{{x[0-9]+}}, #1]
|
|
|
|
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%arr8_sub4095_addr = getelementptr i8, i8* %arr8_addr, i64 4095
|
2015-02-27 21:17:42 +00:00
|
|
|
%arr8_sub4095 = load volatile i8, i8* %arr8_sub4095_addr
|
2013-01-31 12:12:40 +00:00
|
|
|
store volatile i8 %arr8_sub4095, i8* @var_8bit
|
|
|
|
; CHECK: ldrb {{w[0-9]+}}, [{{x[0-9]+}}, #4095]
|
|
|
|
|
|
|
|
|
2015-02-27 21:17:42 +00:00
|
|
|
%arr16_addr = load volatile i16*, i16** @arr16
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK: adrp {{x[0-9]+}}, arr16
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldr {{x[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:arr16]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%arr16_sub1_addr = getelementptr i16, i16* %arr16_addr, i64 1
|
2015-02-27 21:17:42 +00:00
|
|
|
%arr16_sub1 = load volatile i16, i16* %arr16_sub1_addr
|
2013-01-31 12:12:40 +00:00
|
|
|
store volatile i16 %arr16_sub1, i16* @var_16bit
|
|
|
|
; CHECK: ldrh {{w[0-9]+}}, [{{x[0-9]+}}, #2]
|
|
|
|
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%arr16_sub4095_addr = getelementptr i16, i16* %arr16_addr, i64 4095
|
2015-02-27 21:17:42 +00:00
|
|
|
%arr16_sub4095 = load volatile i16, i16* %arr16_sub4095_addr
|
2013-01-31 12:12:40 +00:00
|
|
|
store volatile i16 %arr16_sub4095, i16* @var_16bit
|
|
|
|
; CHECK: ldrh {{w[0-9]+}}, [{{x[0-9]+}}, #8190]
|
|
|
|
|
|
|
|
|
2015-02-27 21:17:42 +00:00
|
|
|
%arr32_addr = load volatile i32*, i32** @arr32
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK: adrp {{x[0-9]+}}, arr32
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldr {{x[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:arr32]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%arr32_sub1_addr = getelementptr i32, i32* %arr32_addr, i64 1
|
2015-02-27 21:17:42 +00:00
|
|
|
%arr32_sub1 = load volatile i32, i32* %arr32_sub1_addr
|
2013-01-31 12:12:40 +00:00
|
|
|
store volatile i32 %arr32_sub1, i32* @var_32bit
|
|
|
|
; CHECK: ldr {{w[0-9]+}}, [{{x[0-9]+}}, #4]
|
|
|
|
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%arr32_sub4095_addr = getelementptr i32, i32* %arr32_addr, i64 4095
|
2015-02-27 21:17:42 +00:00
|
|
|
%arr32_sub4095 = load volatile i32, i32* %arr32_sub4095_addr
|
2013-01-31 12:12:40 +00:00
|
|
|
store volatile i32 %arr32_sub4095, i32* @var_32bit
|
|
|
|
; CHECK: ldr {{w[0-9]+}}, [{{x[0-9]+}}, #16380]
|
|
|
|
|
|
|
|
|
2015-02-27 21:17:42 +00:00
|
|
|
%arr64_addr = load volatile i64*, i64** @arr64
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK: adrp {{x[0-9]+}}, arr64
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldr {{x[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:arr64]
|
2013-01-31 12:12:40 +00:00
|
|
|
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%arr64_sub1_addr = getelementptr i64, i64* %arr64_addr, i64 1
|
2015-02-27 21:17:42 +00:00
|
|
|
%arr64_sub1 = load volatile i64, i64* %arr64_sub1_addr
|
2013-01-31 12:12:40 +00:00
|
|
|
store volatile i64 %arr64_sub1, i64* @var_64bit
|
|
|
|
; CHECK: ldr {{x[0-9]+}}, [{{x[0-9]+}}, #8]
|
|
|
|
|
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
|
|
|
%arr64_sub4095_addr = getelementptr i64, i64* %arr64_addr, i64 4095
|
2015-02-27 21:17:42 +00:00
|
|
|
%arr64_sub4095 = load volatile i64, i64* %arr64_sub4095_addr
|
2013-01-31 12:12:40 +00:00
|
|
|
store volatile i64 %arr64_sub4095, i64* @var_64bit
|
|
|
|
; CHECK: ldr {{x[0-9]+}}, [{{x[0-9]+}}, #32760]
|
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @ldst_float() {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: ldst_float:
|
2013-01-31 12:12:40 +00:00
|
|
|
|
2015-02-27 21:17:42 +00:00
|
|
|
%valfp = load volatile float, float* @var_float
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK: adrp {{x[0-9]+}}, var_float
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldr {{s[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_float]
|
2013-10-31 09:32:11 +00:00
|
|
|
; CHECK-NOFP-NOT: ldr {{s[0-9]+}},
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
store volatile float %valfp, float* @var_float
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: str {{s[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_float]
|
2013-10-31 09:32:11 +00:00
|
|
|
; CHECK-NOFP-NOT: str {{s[0-9]+}},
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @ldst_double() {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: ldst_double:
|
2013-01-31 12:12:40 +00:00
|
|
|
|
2015-02-27 21:17:42 +00:00
|
|
|
%valfp = load volatile double, double* @var_double
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK: adrp {{x[0-9]+}}, var_double
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: ldr {{d[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_double]
|
2013-10-31 09:32:11 +00:00
|
|
|
; CHECK-NOFP-NOT: ldr {{d[0-9]+}},
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
store volatile double %valfp, double* @var_double
|
2014-04-15 14:00:29 +00:00
|
|
|
; CHECK: str {{d[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:var_double]
|
2013-10-31 09:32:11 +00:00
|
|
|
; CHECK-NOFP-NOT: str {{d[0-9]+}},
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|