OSDN Git Service

Reapply [LSR] Create fewer redundant instructions.
authorGeoff Berry <gberry@codeaurora.org>
Mon, 6 Jun 2016 19:10:46 +0000 (19:10 +0000)
committerGeoff Berry <gberry@codeaurora.org>
Mon, 6 Jun 2016 19:10:46 +0000 (19:10 +0000)
commit5c724a4fef84bb71490c839118e1a81d58888757
tree33546a7425614fc930a538c461742b26bef713dd
parent24ef682bfb50055253c893e64a6bb371b05b5b33
Reapply [LSR] Create fewer redundant instructions.

Summary:
Fix LSRInstance::HoistInsertPosition() to check the original insert
position block first for a canonical insertion point that is dominated
by all inputs.  This leads to SCEV being able to reuse more instructions
since it currently tracks the instructions it creates for reuse by
keeping a table of <Value, insert point> pairs.

Originally reviewed in http://reviews.llvm.org/D18001

Reviewers: atrick

Subscribers: llvm-commits, mzolotukhin, mcrosier

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271929 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopStrengthReduce.cpp
test/Transforms/LoopStrengthReduce/AArch64/lsr-reuse.ll [new file with mode: 0644]
test/Transforms/LoopStrengthReduce/scev-insertpt-bug.ll [new file with mode: 0644]