llvm-6502/lib
Jingyue Wu 9cecacd16a Simplify n-ary adds by reassociation
Summary:
This transformation reassociates a n-ary add so that the add can partially reuse
existing instructions. For example, this pass can simplify

  void foo(int a, int b) {
    bar(a + b);
    bar((a + 2) + b);
  }

to

  void foo(int a, int b) {
    int t = a + b;
    bar(t);
    bar(t + 2);
  }

saving one add instruction.

Fixes PR22357 (https://llvm.org/bugs/show_bug.cgi?id=22357).

Test Plan: nary-add.ll

Reviewers: broune, dberlin, hfinkel, meheff, sanjoy, atrick

Reviewed By: sanjoy, atrick

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234855 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-14 04:59:22 +00:00
..
Analysis DebugInfo: Gut DISubprogram and DILexicalBlock* 2015-04-14 03:40:37 +00:00
AsmParser Remove empty non-virtual destructors or mark them =default when non-public 2015-04-11 15:32:26 +00:00
Bitcode DebugInfo: Make MDSubprogram::getFunction() return Constant 2015-04-11 20:27:40 +00:00
CodeGen DebugInfo: Gut DISubprogram and DILexicalBlock* 2015-04-14 03:40:37 +00:00
DebugInfo Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
ExecutionEngine [RuntimeDyldELF] Improve GOT support 2015-04-14 02:10:35 +00:00
Fuzzer Removing a spurious space; NFC. 2015-04-06 16:09:13 +00:00
IR DebugInfo: Update signature of DICompileUnit::replace*() 2015-04-14 03:51:36 +00:00
IRReader Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects. 2015-02-11 03:28:02 +00:00
LineEditor Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects. 2015-02-11 03:28:02 +00:00
Linker DebugInfo: Gut DISubprogram and DILexicalBlock* 2015-04-14 03:40:37 +00:00
LTO Simplify use of formatted_raw_ostream. 2015-04-09 21:06:08 +00:00
MC [MC] Write padding into fragments when -mc-relax-all flag is used 2015-04-12 23:42:25 +00:00
Object Remove more superfluous .str() and replace std::string concatenation with Twine. 2015-03-30 15:42:36 +00:00
Option Remove more superfluous .str() and replace std::string concatenation with Twine. 2015-03-30 15:42:36 +00:00
Passes [PM] Fixup for r231556 where I missed a dependency on intrinsics 2015-03-07 09:08:20 +00:00
ProfileData Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used. 2015-03-23 19:32:43 +00:00
Support Fix SupportsSeeking detection on windows. 2015-04-13 11:09:48 +00:00
TableGen Remove empty non-virtual destructors or mark them =default when non-public 2015-04-11 15:32:26 +00:00
Target DebugInfo: Gut DISubprogram and DILexicalBlock* 2015-04-14 03:40:37 +00:00
Transforms Simplify n-ary adds by reassociation 2015-04-14 04:59:22 +00:00
CMakeLists.txt [PM] Create a separate library for high-level pass management code. 2015-03-07 09:02:36 +00:00
LLVMBuild.txt [PM] Create a separate library for high-level pass management code. 2015-03-07 09:02:36 +00:00
Makefile [PM] Create a separate library for high-level pass management code. 2015-03-07 09:02:36 +00:00