1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
llvm-mirror/test/CodeGen/Generic
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
..
2002-04-14-UnexpectedUnsignedType.ll
2002-04-16-StackFrameSizeAlignment.ll
2003-05-27-phifcmpd.ll
2003-05-27-useboolinotherbb.ll
2003-05-27-usefsubasbool.ll
2003-05-28-ManyArgs.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
2003-05-30-BadFoldGEP.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
2003-05-30-BadPreselectPhi.ll
2003-07-06-BadIntCmp.ll
2003-07-07-BadLongConst.ll
2003-07-08-BadCastToBool.ll
2003-07-29-BadConstSbyte.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
2004-05-09-LiveVarPartialRegister.ll
2005-01-18-SetUO-InfLoop.ll
2005-04-09-GlobalInPHI.ll
2005-10-18-ZeroSizeStackObject.ll
2005-10-21-longlonggtu.ll
2005-12-01-Crash.ll
2005-12-12-ExpandSextInreg.ll
2006-01-12-BadSetCCFold.ll
2006-01-18-InvalidBranchOpcodeAssert.ll
2006-02-12-InsertLibcall.ll
2006-03-01-dagcombineinfloop.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
2006-04-26-SetCCAnd.ll
2006-04-28-Sign-extend-bool.ll
2006-05-06-GEP-Cast-Sink-Crash.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
2006-06-12-LowerSwitchCrash.ll
2006-06-13-ComputeMaskedBitsCrash.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
2006-06-28-SimplifySetCCCrash.ll
2006-07-03-schedulers.ll
2006-08-30-CoalescerCrash.ll
2006-09-02-LocalAllocCrash.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
2006-09-06-SwitchLowering.ll
2006-10-27-CondFolding.ll
2006-10-29-Crash.ll
2006-11-20-DAGCombineCrash.ll
2007-01-15-LoadSelectCycle.ll
2007-02-25-invoke.ll Update to the new EH scheme. 2011-08-25 23:48:37 +00:00
2007-04-08-MultipleFrameIndices.ll Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call 2014-02-13 14:44:26 +00:00
2007-04-13-SwitchLowerBadPhi.ll
2007-04-17-lsr-crash.ll
2007-04-27-InlineAsm-X-Dest.ll Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call 2014-02-13 14:44:26 +00:00
2007-04-27-LargeMemObject.ll Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call 2014-02-13 14:44:26 +00:00
2007-04-30-LandingPadBranchFolding.ll Update to the new EH scheme. 2011-08-25 23:48:37 +00:00
2007-05-03-EHTypeInfo.ll
2007-05-15-InfiniteRecursion.ll
2007-12-17-InvokeAsm.ll Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call 2014-02-13 14:44:26 +00:00
2007-12-31-UnusedSelector.ll Remove all references to the old EH. 2012-01-31 02:09:07 +00:00
2008-01-25-dag-combine-mul.ll
2008-01-30-LoadCrash.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
2008-02-04-Ctlz.ll Manually upgrade the test suite to specify the flag to cttz and ctlz. 2011-12-12 11:59:10 +00:00
2008-02-04-ExtractSubvector.ll
2008-02-20-MatchingMem.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
2008-02-25-NegateZero.ll
2008-02-26-NegatableCrash.ll
2008-08-07-PtrToInt-SmallerInt.ll
2009-03-17-LSR-APInt.ll Use "weak alias" instead of "alias weak" 2014-07-30 22:51:54 +00:00
2009-03-29-SoftFloatVectorExtract.ll
2009-04-10-SinkCrash.ll
2009-04-28-i128-cmp-crash.ll
2009-11-16-BadKillsCrash.ll Remove all references to the old EH. 2012-01-31 02:09:07 +00:00
2010-07-27-DAGCombineCrash.ll Fix a crash in the dag combiner caused by ConstantFoldBIT_CONVERTofBUILD_VECTOR calling itself 2010-07-27 18:02:18 +00:00
2010-11-04-BigByval.ll PR11004: Inline memcpy to avoid generating nested call sequence. Un-XFAIL 2011-06-09-TailCallByVal and 2010-11-04-BigByval 2011-09-26 06:13:20 +00:00
2010-ZeroSizedArg.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2011-01-06-BigNumberCrash.ll Add a testcase for PR8582, which mysteriously fixed itself, in case the problem 2011-01-06 23:04:29 +00:00
2011-07-07-ScheduleDAGCrash.ll ARM: yes it can (as of r218789) 2014-10-01 20:31:58 +00:00
2012-06-08-APIntCrash.ll Fix test case to work on ARM. 2012-06-11 16:01:14 +00:00
2013-03-20-APFloatCrash.ll Add a test case for PR15318 fixed in r177472 2013-03-20 06:18:06 +00:00
2014-02-05-OpaqueConstants.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
add-with-overflow-24.ll
add-with-overflow-128.ll Fixes PR8823: add-with-overflow-128.ll 2010-12-23 03:15:51 +00:00
add-with-overflow.ll
addr-label.ll
annotate.ll Drop @llvm.annotation and @llvm.ptr.annotation intrinsics during codegen. 2013-05-21 14:37:16 +00:00
APIntLoadStore.ll Revert r158209, "test/CodeGen/Generic/APIntLoadStore.ll: Mark as XFAIL:ppc since r157911." 2012-06-21 13:43:06 +00:00
APIntParam.ll
APIntSextParam.ll
APIntZextParam.ll
asm-large-immediate.ll Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call 2014-02-13 14:44:26 +00:00
assume.ll Add @llvm.assume, lowering, and some basic properties 2014-07-25 21:13:35 +00:00
badarg6.ll
badCallArgLRLLVM.ll
badFoldGEP.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
BasicInstrs.ll
bool-to-double.ll
builtin-expect.ll Introduce "expect" intrinsic instructions. 2011-07-06 18:22:43 +00:00
call2-ret0.ll
call-ret0.ll
call-ret42.ll
call-void.ll
cast-fp.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
ConstantExprLowering.ll
constindices.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
crash.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
dag-combine-crash.ll After reducing the size of an operation in the DAG we zero-extend the reduced 2012-12-19 07:39:08 +00:00
dbg_value.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
div-neg-power-2.ll
donothing.ll Fix broken check lines. 2012-08-17 12:28:26 +00:00
edge-bundles-blockIDs.ll Don't run RAFast in the optimizing regalloc pipeline. 2012-06-08 23:15:12 +00:00
empty-insertvalue.ll Fix crash with an insertvalue that produces an empty object. 2014-09-20 00:10:47 +00:00
empty-load-store.ll
empty-phi.ll CodeGen: do not attempt to invalidate virtual registers for zero-sized phis. 2014-12-19 20:50:07 +00:00
exception-handling.ll LSR wants to split the landing pad's critical edge. Let it do it, but use the 2011-08-25 05:55:40 +00:00
externally_available.ll
fastcall.ll
fneg-fabs.ll
fp_to_int.ll
fp-to-int-invalid.ll
fpowi-promote.ll
fwdtwice.ll
global-ret0.ll
hello.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
i128-addsub.ll
i128-arith.ll
inline-asm-mem-clobber.ll Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call 2014-02-13 14:44:26 +00:00
inline-asm-special-strings.ll Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call 2014-02-13 14:44:26 +00:00
intrinsics.ll
invalid-memcpy.ll rip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which is 2011-06-18 06:05:24 +00:00
isunord.ll
llvm-ct-intrinsics.ll Manually upgrade the test suite to specify the flag to cttz and ctlz. 2011-12-12 11:59:10 +00:00
MachineBranchProb.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
Makefile
multiple-return-values-cross-block-with-invoke.ll XFAIL some of the generic CodeGen tests for Hexagon. 2013-03-25 21:04:16 +00:00
negintconst.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
nested-select.ll
no-target.ll Fix pr18235. 2013-12-13 16:05:32 +00:00
overflow.ll add a general coverage test for overflow intrinsics. 2010-12-19 20:01:13 +00:00
overloaded-intrinsic-name.ll overloaded-intrinsic-name: exercise anyptr on struct 2015-01-27 20:03:08 +00:00
PBQP.ll Add a regression test to sanity check the PBQP allocator. 2014-09-03 18:04:10 +00:00
pr2625.ll
pr3288.ll
pr12507.ll Don't try to zExt just to check if an integer constant is zero, it might 2012-04-10 00:16:22 +00:00
print-add.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
print-after.ll CommandLine: Exit successfully for -version and -help 2014-02-28 19:08:01 +00:00
print-arith-fp.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
print-arith-int.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
print-int.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
print-machineinstrs.ll Rename argument strings of codegen passes to avoid collisions with command line 2014-12-13 04:52:04 +00:00
print-mul-exp.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
print-mul.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
print-shift.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
ptr-annotate.ll Drop @llvm.annotation and @llvm.ptr.annotation intrinsics during codegen. 2013-05-21 14:37:16 +00:00
ret0.ll
ret42.ll
select-cc.ll XFAIL some of the generic CodeGen tests for Hexagon. 2013-03-25 21:04:16 +00:00
select.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
shift-int64.ll
stacksave-restore.ll
stop-after.ll Remove the Forward Control Flow Integrity pass and its dependencies. 2015-02-27 19:03:38 +00:00
storetrunc-fp.ll
switch-lower-feature.ll
switch-lower.ll
trap.ll
undef-phi.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
v-split.ll
vector-casts.ll
vector-constantexpr.ll
vector-identity-shuffle.ll
vector.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
zero-sized-array.ll Make codegen able to handle values of empty types. This is one way 2011-05-13 15:18:06 +00:00