llvm-6502/test
Arnold Schwaighofer a47aa4b4ef LoopVectorize: Support conditional stores by scalarizing
The vectorizer takes a loop like this and widens all instructions except for the
store. The stores are scalarized/unrolled and hidden behind an "if" block.

  for (i = 0; i < 128; ++i) {
    if (a[i] < 10)
      a[i] += val;
  }

  for (i = 0; i < 128; i+=2) {
    v = a[i:i+1];
    v0 = (extract v, 0) + 10;
    v1 = (extract v, 1) + 10;
    if (v0 < 10)
      a[i] = v0;
    if (v1 < 10)
      a[i] = v1;
  }

The vectorizer relies on subsequent optimizations to sink instructions into the
conditional block where they are anticipated.

The flag "vectorize-num-stores-pred" controls whether and how many stores to
handle this way. Vectorization of conditional stores is disabled per default for
now.

This patch also adds a change to the heuristic when the flag
"enable-loadstore-runtime-unroll" is enabled (off by default). It unrolls small
loops until load/store ports are saturated. This heuristic uses TTI's
getMaxUnrollFactor as a measure for load/store ports.

I also added a second flag -enable-cond-stores-vec. It will enable vectorization
of conditional stores. But there is no cost model for vectorization of
conditional stores in place yet so this will not do good at the moment.

rdar://15892953

Results for x86-64 -O3 -mavx +/- -mllvm -enable-loadstore-runtime-unroll
-vectorize-num-stores-pred=1 (before the BFI change):

 Performance Regressions:
   Benchmarks/Ptrdist/yacr2/yacr2 7.35% (maze3() is identical but 10% slower)
   Applications/siod/siod         2.18%
 Performance improvements:
   mesa                          -4.42%
   libquantum                    -4.15%

 With a patch that slightly changes the register heuristics (by subtracting the
 induction variable on both sides of the register pressure equation, as the
 induction variable is probably not really unrolled):

 Performance Regressions:
   Benchmarks/Ptrdist/yacr2/yacr2  7.73%
   Applications/siod/siod          1.97%

 Performance Improvements:
   libquantum                    -13.05% (we now also unroll quantum_toffoli)
   mesa                           -4.27%

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200270 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-28 01:01:53 +00:00
..
Analysis Fix crasher introduced in r200203 and caught by a libc++ buildbot. Don't assume that getMulExpr returns a SCEVMulExpr, it may have simplified it to something else! 2014-01-27 10:47:44 +00:00
Assembler Bug 18228 - Fix accepting bitcasts between vectors of pointers with a 2014-01-22 19:21:33 +00:00
Bindings Fix known typos 2014-01-24 17:20:08 +00:00
Bitcode Report a warning when dropping outdated debug info metadata. 2014-01-16 01:51:12 +00:00
BugPoint
CodeGen Fix unsupported addressing mode assertion for pld 2014-01-27 21:39:04 +00:00
DebugInfo [Sparc] Add support for parsing DW_CFA_GNU_window_save. 2014-01-26 05:13:44 +00:00
ExecutionEngine Re-enabling MCJIT tests on ARM 2014-01-25 23:38:08 +00:00
Feature
FileCheck
Instrumentation [asan] extend asan-coverage (still experimental). 2014-01-17 11:00:30 +00:00
Integer
JitListener
Linker Verify that attributes are not lost during linking. 2014-01-24 19:20:15 +00:00
LTO Provide a dummy section to fix a crash with inline assembly in LTO. 2014-01-22 22:11:14 +00:00
MC ARM MC: Fix the initial DWARF CFI unwind info at the start of a function 2014-01-27 22:38:14 +00:00
Object Fix "llvm-objdump -d -r" to show relocations inline for ELF files 2014-01-25 17:38:19 +00:00
Other [PM] Wire up the Verifier for the new pass manager and connect it to the 2014-01-20 11:34:08 +00:00
TableGen
tools Rename IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA. 2014-01-27 04:22:24 +00:00
Transforms LoopVectorize: Support conditional stores by scalarizing 2014-01-28 01:01:53 +00:00
Unit
Verifier [PM] Make the verifier work independently of any pass manager. 2014-01-19 02:22:18 +00:00
YAMLParser
.clang-format
CMakeLists.txt [CMake] Add llvm-tblgen to dependencies of check-llvm. 2014-01-18 19:01:08 +00:00
lit.cfg Eliminate inappropriate use of FindProgramByName() from lli 2014-01-22 21:52:35 +00:00
lit.site.cfg.in Eliminate inappropriate use of FindProgramByName() from lli 2014-01-22 21:52:35 +00:00
Makefile Eliminate inappropriate use of FindProgramByName() from lli 2014-01-22 21:52:35 +00:00
Makefile.tests
TestRunner.sh