1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/test/DebugInfo/X86
David Blaikie 0d99339102 [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
2015-02-27 19:29:02 +00:00
..
2010-04-13-PubType.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
2011-09-26-GlobalVarContext.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
2011-12-16-BadStructRef.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
aligned_stack_var.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
arange.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
arguments.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
array2.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
array.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
asm-macro-line-number.s IAS: correct debug line info for asm macros 2014-12-24 06:32:43 +00:00
block-capture.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
byvalstruct.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
c-type-units.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
coff_debug_info_type.ll MC: Emit COFF section flags in the "proper" order 2015-02-07 08:26:40 +00:00
coff_relative_names.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
concrete_out_of_line.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
constant-aggregate.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
cu-ranges-odr.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
cu-ranges.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
data_member_location.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
dbg_value_direct.ll Remove support for DIVariable's FlagIndirectVariable and expect 2015-01-19 17:57:29 +00:00
dbg-asm.s MC: correct DWARF line info for PE/COFF 2014-09-06 19:57:48 +00:00
dbg-at-specficiation.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
dbg-byval-parameter.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
dbg-const-int.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dbg-const.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dbg-declare-arg.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
dbg-declare.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dbg-file-name.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
dbg-i128-const.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dbg-merge-loc-entry.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dbg-prolog-end.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dbg-subrange.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dbg-value-const-byref.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dbg-value-dag-combine.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
dbg-value-inlined-parameter.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
dbg-value-isel.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dbg-value-location.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dbg-value-range.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
dbg-value-terminator.ll DebugInfo: Match Name and DisplayName in testcase 2015-02-19 23:48:17 +00:00
debug_frame.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
debug-dead-local-var.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
debug-info-access.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
debug-info-block-captured-self.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
debug-info-blocks.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
debug-info-static-member.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
debug-loc-asan.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
debug-loc-offset.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
debug-ranges-offset.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
decl-derived-member.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
discriminator.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
DW_AT_byte_size.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
DW_AT_linkage_name.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
DW_AT_location-reference.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
DW_AT_object_pointer.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
DW_AT_specification.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
DW_AT_stmt_list_sec_offset.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
DW_TAG_friend.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
dwarf-aranges-no-dwarf-labels.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dwarf-aranges.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dwarf-public-names.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
dwarf-pubnames-split.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
earlydup-crash.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
elf-names.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
empty-and-one-elem-array.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
empty-array.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
ending-run.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
enum-class.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
enum-fwd-decl.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
fission-cu.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
fission-hash.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
fission-inline.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
fission-ranges.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
float_const.ll Debug Info: Relax assertion in isUnsignedDIType() to allow floats to be 2015-02-02 18:31:58 +00:00
formal_parameter.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
generate-odr-hash.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
ghost-sdnode-dbgvalues.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
gmlt.test llvm/test/DebugInfo/X86/gmlt.test: Get rid of %llc_dwarf. It should not be used with -mtriple. 2014-10-01 00:29:16 +00:00
gnu-public-names-empty.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
gnu-public-names.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
inline-member-function.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
inline-seldag-test.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
instcombine-instrinsics.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
lexical_block.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
line-info.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
line.test Refactor test to be reused across architectures 2015-01-29 20:21:24 +00:00
linkage-name.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
lit.local.cfg Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
low-pc-cu.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
main-file-name.s Now that llvm-dwarfdump supports flags to specify which DWARF section to dump, 2013-01-25 21:44:53 +00:00
memberfnptr.ll Debug Info: In symmetry to DW_TAG_pointer_type, do not emit the byte size 2014-12-24 01:17:51 +00:00
misched-dbg-value.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
multiple-aranges.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
multiple-at-const-val.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
nodebug_with_debug_loc.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
nondefault-subrange-array.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
nophysreg.ll Debug info: Use DW_OP_bit_piece instead of DW_OP_piece in the 2015-02-09 23:57:15 +00:00
objc-fwd-decl.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
objc-property-void.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
op_deref.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
parameters.ll Remove support for DIVariable's FlagIndirectVariable and expect 2015-01-19 17:57:29 +00:00
pieces-1.ll Debug info: Use DW_OP_bit_piece instead of DW_OP_piece in the 2015-02-09 23:57:15 +00:00
pieces-2.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
pieces-3.ll Debug info: Use DW_OP_bit_piece instead of DW_OP_piece in the 2015-02-09 23:57:15 +00:00
pointer-type-size.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
pr11300.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
pr12831.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
pr13303.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
pr19307.ll Remove support for DIVariable's FlagIndirectVariable and expect 2015-01-19 17:57:29 +00:00
processes-relocations.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
prologue-stack.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
recursive_inlining.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
ref_addr_relocation.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
reference-argument.ll Remove support for DIVariable's FlagIndirectVariable and expect 2015-01-19 17:57:29 +00:00
rvalue-ref.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
sret.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
sroasplit-1.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
sroasplit-2.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
sroasplit-3.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
sroasplit-4.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
sroasplit-5.ll Debug info: When updating debug info during SROA, do not emit debug info 2015-02-09 23:57:22 +00:00
stmt-list-multiple-compile-units.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
stmt-list.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
stringpool.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
struct-loc.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
subrange-type.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
subreg.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
subregisters.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
template.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
tls.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
type_units_with_addresses.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
union-const.ll Debug Info / PR22309: Allow union types to be emitted as unsigned constants. 2015-01-23 18:01:39 +00:00
union-template.ll IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
vector.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
vla.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00