llvm-6502/include/llvm/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
..
InstCombine Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
IPO libLTO, llvm-lto, gold: Introduce flag for controlling optimization level. 2015-03-19 22:01:00 +00:00
Scalar [PM] Clean up a stale comment that came from a differnt pass when 2015-02-01 11:35:56 +00:00
Utils [LoopUnrollRuntime] Avoid high-cost trip count computation. 2015-04-14 03:20:38 +00:00
Instrumentation.h GCOV: Make the exit block placement from r223193 optional 2015-03-16 23:52:03 +00:00
IPO.h Introduce bitset metadata format and bitset lowering pass. 2015-02-20 20:30:47 +00:00
ObjCARC.h Reformat linefeeds. 2014-05-26 00:25:26 +00:00
Scalar.h Simplify n-ary adds by reassociation 2015-04-14 04:59:22 +00:00
Vectorize.h Allow vectorization of bit intrinsics in BB Vectorizer. 2014-04-25 03:33:48 +00:00