diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2017-02-08 02:48:25 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@dberlin.org> | 2017-02-08 02:48:25 +0000 |
commit | 73eb7fe478f8071675735e1d06fcad7c9ea34918 (patch) | |
tree | 1bd0899451b7d2a6fbbd8bb671d967354d462bf3 /llvm/lib | |
parent | b83cfb772409df182f18049f6439777ff4fdc25b (diff) | |
download | bcm5719-llvm-73eb7fe478f8071675735e1d06fcad7c9ea34918.tar.gz bcm5719-llvm-73eb7fe478f8071675735e1d06fcad7c9ea34918.zip |
Revert "CVP: Make CVP iterate in an order that maximizes reuse of LVI cache"
This reverts commit r294398, it seems to be failing on the bots.
llvm-svn: 294399
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp index f623b81df3a..60786a3373f 100644 --- a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp +++ b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp @@ -481,11 +481,12 @@ static Constant *getConstantAt(Value *V, Instruction *At, LazyValueInfo *LVI) { static bool runImpl(Function &F, LazyValueInfo *LVI) { bool FnChanged = false; - // Visiting in an inverse depth first traversal maximizes reuse of the LVI - // cache, as it currently iterates in depth first order upwards, caching - // overdefined info as it goes. - - for (BasicBlock *BB : inverse_depth_first(&F.getEntryBlock())) { + // Visiting in a pre-order depth-first traversal causes us to simplify early + // blocks before querying later blocks (which require us to analyze early + // blocks). Eagerly simplifying shallow blocks means there is strictly less + // work to do for deep blocks. This also means we don't visit unreachable + // blocks. + for (BasicBlock *BB : depth_first(&F.getEntryBlock())) { bool BBChanged = false; for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE;) { Instruction *II = &*BI++; |