llvm-6502/test/CodeGen
Hal Finkel b8a6712c27 [PowerPC] Prepare loops for pre-increment loads/stores
PowerPC supports pre-increment load/store instructions (except for Altivec/VSX
vector load/stores). Using these on embedded cores can be very important, but
most loops are not naturally set up to use them. We can often change that,
however, by placing loops into a non-canonical form. Generically, this means
transforming loops like this:

  for (int i = 0; i < n; ++i)
    array[i] = c;

to look like this:

  T *p = array[-1];
  for (int i = 0; i < n; ++i)
    *++p = c;

the key point is that addresses accessed are pulled into dedicated PHIs and
"pre-decremented" in the loop preheader. This allows the use of pre-increment
load/store instructions without loop peeling.

A target-specific late IR-level pass (running post-LSR), PPCLoopPreIncPrep, is
introduced to perform this transformation. I've used this code out-of-tree for
generating code for the PPC A2 for over a year. Somewhat to my surprise,
running the test suite + externals on a P7 with this transformation enabled
showed no performance regressions, and one speedup:

External/SPEC/CINT2006/483.xalancbmk/483.xalancbmk
	-2.32514% +/- 1.03736%

So I'm going to enable it on everything for now. I was surprised by this
because, on the POWER cores, these pre-increment load/store instructions are
cracked (and, thus, harder to schedule effectively). But seeing no regressions,
and feeling that it is generally easier to split instructions apart late than
it is to combine them late, this might be the better approach regardless.

In the future, we might want to integrate this functionality into LSR (but
currently LSR does not create new PHI nodes, so (for that and other reasons)
significant work would need to be done).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228328 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 18:43:00 +00:00
..
AArch64 MachineCSE: Clear dead-def flag on CSE. 2015-02-04 19:35:16 +00:00
ARM [ARM] Use patterns instead of hardcoded regs in test. NFC. 2015-02-05 01:52:19 +00:00
BPF
CPP
Generic
Hexagon [Hexagon] Adding encoding information for absolute-reg mode stores. Xfailing a test until constant extenders are correctly put in the same packet. 2015-02-04 17:52:06 +00:00
Inputs
Mips [mips][microMIPS] Implement CodeGen support for SW16 and LW16 instructions 2015-02-04 15:43:17 +00:00
MSP430
NVPTX [NVPTX] Emit .pragma "nounroll" for loops marked with nounroll 2015-02-01 02:27:45 +00:00
PowerPC [PowerPC] Prepare loops for pre-increment loads/stores 2015-02-05 18:43:00 +00:00
R600 R600/SI: Fix bug in TTI loop unrolling preferences 2015-02-05 15:32:18 +00:00
SPARC
SystemZ
Thumb
Thumb2
X86 [CodeGen] Add hook/combine to form vector extloads, enabled on X86. 2015-02-05 18:31:02 +00:00
XCore