llvm-6502/lib/Transforms
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
..
Hello
InstCombine GCC complains thusly: "attributes at the beginning of statement are ignored [-Werror=attributes]". Very well then! NFC 2015-04-13 20:03:08 +00:00
Instrumentation DebugInfo: Gut DISubprogram and DILexicalBlock* 2015-04-14 03:40:37 +00:00
IPO DebugInfo: Update signature of DICompileUnit::replace*() 2015-04-14 03:51:36 +00:00
ObjCARC Remove empty non-virtual destructors or mark them =default when non-public 2015-04-11 15:32:26 +00:00
Scalar Simplify n-ary adds by reassociation 2015-04-14 04:59:22 +00:00
Utils DebugInfo: Update signature of DICompileUnit::replace*() 2015-04-14 03:51:36 +00:00
Vectorize Reduce dyn_cast<> to isa<> or cast<> where possible. 2015-04-10 11:24:51 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile