llvm-6502/test/MC/ARM
David Blaikie 198d8baafb [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
..
AlignedBundling
Windows ARM: fail less catastrophically on invalid Windows input 2015-01-22 04:03:32 +00:00
2010-11-30-reloc-movt.s
2013-03-18-Br-to-label-named-like-reg.s
align_arm_2_thumb.s
align_thumb_2_arm.s
arm_addrmode2.s
arm_addrmode3.s
arm_fixups.s
arm_instructions.s Remove the cortex-a9-mp CPU. 2014-11-03 17:38:00 +00:00
arm-aliases.s
arm-arithmetic-aliases.s
arm-elf-relocation-diagnostics.s ARM: add support for segment base relocations (SBREL) 2015-01-11 04:39:18 +00:00
arm-elf-relocations.s ARM: add support for segment base relocations (SBREL) 2015-01-11 04:39:18 +00:00
arm-elf-symver.s
arm-it-block.s
arm-ldrd.s
arm-load-store-multiple-deprecated.s ARM: further improve deprecated diagnosis (LDM) 2014-12-20 20:25:36 +00:00
arm-memory-instructions.s
arm-qualifier-diagnostics.s
arm-shift-encoding.s
arm-thumb-cpus-default.s
arm-thumb-cpus.s [ARM] Add armv6s[-]m as an alias to armv6[-]m 2015-02-10 15:15:08 +00:00
arm-thumb-trustzone.s
arm-trustzone.s
basic-arm-instructions-v8.s
basic-arm-instructions.s ARM: Fix another regression introduced in r223113 2015-02-12 13:37:28 +00:00
basic-thumb2-instructions-v8.s
basic-thumb2-instructions.s
basic-thumb-instructions.s
big-endian-arm-fixup.s
big-endian-thumb2-fixup.s
big-endian-thumb-fixup.s
bkpt.s
bracket-darwin.s
bracket-exprs.s
cmp-immediate-fixup2.s
cmp-immediate-fixup-error2.s
cmp-immediate-fixup-error.s
cmp-immediate-fixup.s
coff-debugging-secrel.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
coff-file.s
coff-function-type-info.ll
coff-relocations.s
comment.s
complex-operands.s
coproc-diag.s
cps.s
cpu-test.s [ARM] Fix subtarget feature set truncation when using .cpu directive 2015-02-04 16:23:24 +00:00
crc32-thumb.s
crc32.s
cxx-global-constructor.ll
d16.s Fix bashism in tests added by r221341 2014-11-05 12:40:21 +00:00
data-in-code.ll Change the fast-isel-abort option from bool to int to enable "levels" 2015-02-27 18:32:11 +00:00
deprecated-v8.s
diagnostics-noneon.s
diagnostics.s Add support for ARM modified-immediate assembly syntax. 2014-12-02 10:53:20 +00:00
directive-align.s
directive-arch_extension-crc.s
directive-arch_extension-crypto.s
directive-arch_extension-fp.s
directive-arch_extension-idiv.s
directive-arch_extension-mode-switch.s
directive-arch_extension-mp.s
directive-arch_extension-sec.s
directive-arch_extension-simd.s
directive-arch_extension-toggle.s
directive-arch-armv2.s
directive-arch-armv2a.s
directive-arch-armv3.s
directive-arch-armv3m.s
directive-arch-armv4.s
directive-arch-armv4t.s
directive-arch-armv5.s
directive-arch-armv5t.s
directive-arch-armv5te.s
directive-arch-armv6-m.s
directive-arch-armv6.s
directive-arch-armv6j.s
directive-arch-armv6t2.s
directive-arch-armv6z.s
directive-arch-armv6zk.s
directive-arch-armv7-a.s
directive-arch-armv7-m.s
directive-arch-armv7-r.s
directive-arch-armv7.s
directive-arch-armv7a.s
directive-arch-armv7m.s
directive-arch-armv7r.s
directive-arch-armv8-a.s
directive-arch-armv8a.s
directive-arch-iwmmxt2.s Stop uppercasing build attribute data. 2014-11-27 12:13:56 +00:00
directive-arch-iwmmxt.s Stop uppercasing build attribute data. 2014-11-27 12:13:56 +00:00
directive-cpu.s Stop uppercasing build attribute data. 2014-11-27 12:13:56 +00:00
directive-eabi_attribute-diagnostics.s Parse Tag_compatibility correctly. 2015-01-05 13:26:37 +00:00
directive-eabi_attribute-overwrite.s Parse Tag_compatibility correctly. 2015-01-05 13:26:37 +00:00
directive-eabi_attribute.s Parse Tag_compatibility correctly. 2015-01-05 13:26:37 +00:00
directive-even.s
directive-fpu-diagnostics.s ARM: improve caret diagnostics for invalid FPU name 2015-01-30 18:42:10 +00:00
directive-fpu-instrs.s [ARM] Honor FeatureD16 in the assembler and disassembler 2014-11-05 12:06:39 +00:00
directive-fpu-multiple.s
directive-fpu-softvfp.s
directive-fpu.s
directive-literals.s
directive-object_arch-2.s
directive-object_arch-3.s
directive-object_arch-diagnostics.s
directive-object_arch.s
directive-thumb_func.s
directive-tlsdescseq-diagnostics.s
directive-tlsdescseq.s
directive-unsupported.s
directive-word-diagnostics.s
dot-req-case-insensitive.s
dot-req.s Fix some unnoticed/unwanted behavior change from r222319. 2015-02-04 03:10:03 +00:00
dwarf-asm-multiple-sections-dwarf-2.s
dwarf-asm-multiple-sections.s
dwarf-asm-no-code.s
dwarf-asm-nonstandard-section.s
dwarf-asm-single-section.s
dwarf-cfi-initial-state.s
eh-compact-pr0.s
eh-compact-pr1.s
eh-directive-cantunwind-diagnostics.s
eh-directive-cantunwind.s
eh-directive-fnend-diagnostics.s
eh-directive-fnstart-diagnostics.s
eh-directive-handlerdata.s
eh-directive-integrated-test.s
eh-directive-movsp-diagnostics.s
eh-directive-movsp.s
eh-directive-multiple-offsets.s
eh-directive-pad-diagnostics.s
eh-directive-pad.s
eh-directive-personality-diagnostics.s
eh-directive-personality.s
eh-directive-personalityindex-diagnostics.s
eh-directive-personalityindex.s
eh-directive-save-diagnostics.s
eh-directive-save.s
eh-directive-section-comdat.s
eh-directive-section-multiple-func.s
eh-directive-section.s
eh-directive-setfp-diagnostics.s
eh-directive-setfp.s
eh-directive-text-section-multiple-func.s
eh-directive-text-section.s
eh-directive-unwind_raw-diagnostics.s
eh-directive-unwind_raw.s
eh-directive-vsave-diagnostics.s
eh-directive-vsave.s
elf-eflags-eabi.s
elf-jump24-fixup.s
elf-movt.s
elf-reloc-01.ll
elf-reloc-02.ll
elf-reloc-03.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
elf-reloc-condcall.s
elf-thumbfunc-reloc.ll
elf-thumbfunc-reloc.s
elf-thumbfunc.s
fconst.s
fixup-cpu-mode.s
fp-armv8.s
fp-const-errors.s
full_line_comment.s
gas-compl-copr-reg.s
hilo-16bit-relocations.s
idiv.s
inst-arm-suffixes.s
inst-constant-required.s
inst-directive-emit.s
inst-directive.s
inst-overflow.s
inst-thumb-overflow-2.s
inst-thumb-overflow.s
inst-thumb-suffixes.s
invalid-barrier.s
invalid-crc32.s
invalid-fp-armv8.s
invalid-hint-arm.s
invalid-hint-thumb.s
invalid-idiv.s
invalid-neon-v8.s
invalid-vector-index.s
ldr-pseudo-darwin.s
ldr-pseudo-obj-errors.s
ldr-pseudo-parse-errors.s Fix yet another unseen regression caused by r223113 2014-12-04 19:34:59 +00:00
ldr-pseudo.s
ldrd-strd-gnu-arm-bad-imm.s
ldrd-strd-gnu-arm.s
ldrd-strd-gnu-sp.s
ldrd-strd-gnu-thumb-bad-regs.s
ldrd-strd-gnu-thumb.s
lit.local.cfg
load-store-acquire-release-v8-thumb.s
load-store-acquire-release-v8.s
ltorg-darwin.s
ltorg.s
macho-relocs-with-addend.s
mapping-within-section.s
mode-switch.s
move-banked-regs.s Fix wrong encoding of MRSBanked. 2014-11-28 15:01:06 +00:00
mul-v4.s
multi-section-mapping.s
neon-abs-encoding.s
neon-absdiff-encoding.s
neon-add-encoding.s
neon-bitcount-encoding.s
neon-bitwise-encoding.s
neon-cmp-encoding.s
neon-convert-encoding.s
neon-crypto.s
neon-dup-encoding.s
neon-minmax-encoding.s
neon-mov-encoding.s
neon-mov-vfp.s
neon-mul-accum-encoding.s
neon-mul-encoding.s
neon-neg-encoding.s
neon-pairwise-encoding.s
neon-reciprocal-encoding.s
neon-reverse-encoding.s
neon-satshift-encoding.s
neon-shift-encoding.s
neon-shiftaccum-encoding.s
neon-shuffle-encoding.s
neon-sub-encoding.s
neon-table-encoding.s
neon-v8.s
neon-vld-encoding.s
neon-vld-vst-align.s
neon-vst-encoding.s
neon-vswp.s
neont2-abs-encoding.s
neont2-absdiff-encoding.s
neont2-add-encoding.s
neont2-bitcount-encoding.s
neont2-bitwise-encoding.s
neont2-cmp-encoding.s
neont2-convert-encoding.s
neont2-dup-encoding.s
neont2-minmax-encoding.s
neont2-mov-encoding.s
neont2-mul-accum-encoding.s
neont2-mul-encoding.s
neont2-neg-encoding.s
neont2-pairwise-encoding.s
neont2-reciprocal-encoding.s
neont2-reverse-encoding.s
neont2-satshift-encoding.s
neont2-shift-encoding.s
neont2-shiftaccum-encoding.s
neont2-shuffle-encoding.s
neont2-sub-encoding.s
neont2-table-encoding.s
neont2-vld-encoding.s
neont2-vst-encoding.s
not-armv4.s
obsolete-v8.s
pool.s
pr11877.s
pr22395-2.s ARM: further correct .fpu directive handling 2015-01-30 19:35:18 +00:00
pr22395.s ARM: correct handling of .fpu directive 2015-01-30 17:58:25 +00:00
relocated-mapping.s
simple-fp-encoding.s
single-precision-fp.s
symbol-variants-errors.s
symbol-variants.s [ELF] Prevent ARM ELF object writer from generating deprecated relocation code R_ARM_PLT32 2014-11-20 05:58:11 +00:00
target-expressions.s
thumb2-b.w-encodingT4.s
thumb2-branches.s
thumb2-bxj.s
thumb2-cbn-to-next-inst.s
thumb2-diagnostics.s [ARM] SSAT/USAT with an 'asr #32' shift should result in an undefined encoding rather than unpredictable 2015-01-19 16:37:17 +00:00
thumb2-dsp-diag.s [ARM] Fixup sign extend instruction availability w.r.t. DSP extension 2015-01-19 16:36:02 +00:00
thumb2-exception-return-mclass.s
thumb2-ldrb-ldrh.s
thumb2-ldrd.s
thumb2-ldrexd-strexd.s
thumb2-mclass.s
thumb2-narrow-dp.ll
thumb2-pldw.s
thumb2-strd.s
thumb2be-b.w-encoding.s
thumb2be-beq.w-encoding.s
thumb2be-movt-encoding.s
thumb2be-movw-encoding.s
thumb_rewrites.s
thumb_set-diagnostics.s
thumb_set.s
thumb-diagnostics.s ARM: improve instruction validation for thumb mode 2014-12-18 05:24:38 +00:00
thumb-far-jump.s
thumb-fp-armv8.s
thumb-hints.s
thumb-invalid-crypto.txt
thumb-load-store-multiple.s Correct POP handling for v7m 2015-01-14 10:48:16 +00:00
thumb-neon-crypto.s
thumb-neon-v8.s
thumb-not-mclass.s
thumb-only-conditionals.s
thumb-shift-encoding.s
thumb-st_other.s
thumb-types.s
thumb.s
thumbv7em.s
thumbv7m.s
udf-arm-diagnostics.s
udf-arm.s
udf-thumb-2-diagnostics.s
udf-thumb-2.s
udf-thumb-diagnostics.s
udf-thumb.s
unwind-stack-diagnostics.s
v8_IT_manual.s ARM: improve instruction validation for thumb mode 2014-12-18 05:24:38 +00:00
variant-diagnostics.s
vfp4.s [ARM] Honor FeatureD16 in the assembler and disassembler 2014-11-05 12:06:39 +00:00
vfp-aliases-diagnostics.s
vfp-aliases.s
virtexts-arm.s Add ARM ERET and HVC virtualisation extension instructions. 2014-12-01 08:33:28 +00:00
virtexts-thumb.s Add Thumb HVC and ERET virtualisation extension instructions. 2014-12-01 08:39:19 +00:00
vmov-vmvn-byte-replicate.s
vmov-vmvn-illegal-cases.s
vorr-vbic-illegal-cases.s
vpush-vpop.s