1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/test
Jingyue Wu 4e99b65428 Add straight-line strength reduction to LLVM
Summary:
Straight-line strength reduction (SLSR) is implemented in GCC but not yet in
LLVM. It has proven to effectively simplify statements derived from an unrolled
loop, and can potentially benefit many other cases too. For example,

LLVM unrolls

  #pragma unroll
  foo (int i = 0; i < 3; ++i) {
    sum += foo((b + i) * s);
  }

into

  sum += foo(b * s);
  sum += foo((b + 1) * s);
  sum += foo((b + 2) * s);

However, no optimizations yet reduce the internal redundancy of the three
expressions:

  b * s
  (b + 1) * s
  (b + 2) * s

With SLSR, LLVM can optimize these three expressions into:

  t1 = b * s
  t2 = t1 + s
  t3 = t2 + s

This commit is only an initial step towards implementing a series of such
optimizations. I will implement more (see TODO in the file commentary) in the
near future. This optimization is enabled for the NVPTX backend for now.
However, I am more than happy to push it to the standard optimization pipeline
after more thorough performance tests.

Test Plan: test/StraightLineStrengthReduce/slsr.ll

Reviewers: eliben, HaoLiu, meheff, hfinkel, jholewinski, atrick

Reviewed By: jholewinski, atrick

Subscribers: karthikthecool, jholewinski, llvm-commits

Differential Revision: http://reviews.llvm.org/D7310

llvm-svn: 228016
2015-02-03 19:37:06 +00:00
..
Analysis [PM] Change the core design of the TTI analysis to use a polymorphic 2015-01-31 03:43:40 +00:00
Assembler IR: Update references to temporaries before deleting 2015-01-22 21:36:45 +00:00
Bindings Propagate a better error message to the C api. 2015-02-03 01:53:03 +00:00
Bitcode Check bit widths before trying to get a type. 2015-01-30 18:13:50 +00:00
BugPoint IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
CodeGen [Hexagon] Updating XTYPE/PERM intrinsics. 2015-02-03 19:36:59 +00:00
DebugInfo Debug Info: Relax assertion in isUnsignedDIType() to allow floats to be 2015-02-02 18:31:58 +00:00
ExecutionEngine [Orc] Make OrcMCJITReplacement::addObject calls transfer buffer ownership to the 2015-02-02 19:51:18 +00:00
Feature IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
FileCheck
Instrumentation tsan: properly instrument unaligned accesses 2015-01-27 20:19:17 +00:00
Integer
JitListener IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
Linker IR: Move MDLocation into place 2015-01-14 22:27:36 +00:00
LTO Introduce llvm/test/LTO/X86. LTO tests may be assumed as target-specific. 2015-01-30 10:09:26 +00:00
MC [Hexagon] Adding missing vector multiply instruction encodings. Converting multiply intrinsics and updating tests. 2015-02-03 19:15:11 +00:00
Object [ELFYAML] Provide default value 0 for YAML relocation addendum field 2015-01-29 06:56:24 +00:00
Other [PM] Teach the module-to-function adaptor to not run function passes 2015-02-01 10:47:25 +00:00
SymbolRewriter SymbolRewriter: allow rewriting with comdats 2015-01-27 22:57:39 +00:00
TableGen
tools llvm-readobj: add a test case for ARM_MOV32(T) base relocation 2015-01-31 04:46:50 +00:00
Transforms Add straight-line strength reduction to LLVM 2015-02-03 19:37:06 +00:00
Unit
Verifier Fix statepoint verifier tests to actually test verifier. 2015-01-30 23:18:42 +00:00
YAMLParser
.clang-format
CMakeLists.txt Revert r224149, llvm-dsymutil was already here. 2014-12-12 21:25:07 +00:00
lit.cfg llvm/test/lit.cfg: have_ld_plugin_support(): Use decode() for stdout. 2015-01-05 14:18:04 +00:00
lit.site.cfg.in Reverting r226937: lit: Make MCJIT's supported arch check case insensitive 2015-01-24 01:42:44 +00:00
Makefile [lit] Make config.llvm_lib_dir available on cmake, too. 2014-12-30 03:24:11 +00:00
Makefile.tests
TestRunner.sh