llvm-6502/test
Ulrich Weigand f0ef882828 [PowerPC] Report true displacement value from getPreIndexedAddressParts
DAGCombiner::CombineToPreIndexedLoadStore calls a target routine to
decompose a memory address into a base/offset pair.  It expects the
offset (if constant) to be the true displacement value in order to
perform optional additional optimizations; in particular, to convert
other uses of the original pointer into uses of the new base pointer
after pre-increment.

The PowerPC implementation of getPreIndexedAddressParts, however,
simply calls SelectAddressRegImm, which returns a TargetConstant.
This value is appropriate for encoding into the instruction, but
it is not always usable as true displacement value:

- Its type is always MVT::i32, even on 64-bit, where addresses
  ought to be i64 ... this causes the optimization to simply
  always fail on 64-bit due to this line in DAGCombiner:

      // FIXME: In some cases, we can be smarter about this.
      if (Op1.getValueType() != Offset.getValueType()) {

- Its value is truncated to an unsigned 16-bit value if negative.
  This causes the above opimization to generate wrong code.

This patch fixes both problems by simply returning the true
displacement value (in its original type).  This doesn't
affect any other user of the displacement.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182012 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-16 14:53:05 +00:00
..
Analysis AArch64: use MCJIT by default and enable related tests. 2013-05-06 16:51:08 +00:00
Archive
Assembler
Bindings/Ocaml
Bitcode
BugPoint
CodeGen [PowerPC] Report true displacement value from getPreIndexedAddressParts 2013-05-16 14:53:05 +00:00
DebugInfo Give the test from r181632 a target triple. 2013-05-10 22:14:39 +00:00
ExecutionEngine XFAIL this test for mingw too. 2013-05-13 00:18:24 +00:00
Feature
FileCheck Add 'CHECK-DAG' support 2013-05-14 20:34:12 +00:00
Instrumentation [msan] Switch TLS globals to initial-exec model. 2013-05-16 09:14:05 +00:00
Integer
JitListener
Linker
MC [PowerPC] Remove need for adjustFixupOffst hack 2013-05-15 15:07:06 +00:00
Object Object: Fix Mach-O relocation printing. 2013-05-14 22:41:29 +00:00
Other
TableGen
tools
Transforms Respect the 'nobuiltin' attribute when determining if a call is to a memory builtin. 2013-05-16 04:12:04 +00:00
Unit
Verifier
YAMLParser
CMakeLists.txt
lit.cfg AArch64: use MCJIT by default and enable related tests. 2013-05-06 16:51:08 +00:00
lit.site.cfg.in Allow host triple to be correctly overridden in CMake builds 2013-05-04 07:36:23 +00:00
Makefile Allow host triple to be correctly overridden in CMake builds 2013-05-04 07:36:23 +00:00
Makefile.tests
TestRunner.sh