llvm-6502/lib
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
..
Analysis Value soft float calls as more expensive in the inliner. 2015-02-05 02:09:33 +00:00
AsmParser AsmParser: Split out LineField, NFC 2015-02-04 22:59:18 +00:00
Bitcode IR: Initialize MDNode abbreviations en masse, NFC 2015-02-04 21:54:12 +00:00
CodeGen [CodeGen] Add hook/combine to form vector extloads, enabled on X86. 2015-02-05 18:31:02 +00:00
DebugInfo Move DebugInfo to DebugInfo/DWARF. 2015-01-30 18:07:45 +00:00
ExecutionEngine [MC] Remove various unused MCAsmInfo parameters. 2015-02-05 00:58:51 +00:00
Fuzzer [fuzzer] add flag prefer_small_during_initial_shuffle, be a bit more verbose 2015-02-04 23:42:42 +00:00
IR Teach isDereferenceablePointer() to look through bitcast constant expressions. 2015-02-05 09:15:37 +00:00
IRReader Remove unused variable. NFC. 2014-11-06 23:16:57 +00:00
LineEditor
Linker [llvm link] Destroy ConstantArrays in LLVMContext if they are not used. 2015-01-20 19:24:59 +00:00
LTO [LTO API] split lto_codegen_compile to lto_codegen_optimize and 2015-02-03 18:39:15 +00:00
MC Try to fix the build in MCValue.cpp 2015-02-05 01:23:14 +00:00
Object [ELFYAML] Provide default value 0 for YAML relocation addendum field 2015-01-29 06:56:24 +00:00
Option [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
ProfileData InstrProf: Use a stable sort when reading coverage regions 2015-02-04 00:12:18 +00:00
Support SpecialCaseList: Add support for parsing multiple input files. 2015-02-04 17:39:48 +00:00
TableGen Replace size method call of containers to empty method where appropriate 2015-01-15 11:41:30 +00:00
Target [PowerPC] Prepare loops for pre-increment loads/stores 2015-02-05 18:43:00 +00:00
Transforms LowerSwitch: Use ConstantInt for CaseRange::{Low,High} 2015-02-05 16:58:10 +00:00
CMakeLists.txt Reverting r227452, which adds back the fuzzer library. Now excluding the fuzzer library based on LLVM_USE_SANITIZE_COVERAGE being set or unset. 2015-01-29 16:58:29 +00:00
LLVMBuild.txt
Makefile Move DebugInfo to DebugInfo/DWARF. 2015-01-30 18:07:45 +00:00