diff options
author | Igor Laevsky <igmyrj@gmail.com> | 2016-10-11 13:37:22 +0000 |
---|---|---|
committer | Igor Laevsky <igmyrj@gmail.com> | 2016-10-11 13:37:22 +0000 |
commit | 04423cf785f917220a19e803c58f4f5023108137 (patch) | |
tree | efa1d0b427ae7e133c3c83b6e98a1f6dd7240611 /llvm/lib/Transforms/Utils/LoopSimplify.cpp | |
parent | 6d71f7b348f10edfe134fb361b026eb49e777700 (diff) | |
download | bcm5719-llvm-04423cf785f917220a19e803c58f4f5023108137.tar.gz bcm5719-llvm-04423cf785f917220a19e803c58f4f5023108137.zip |
[LCSSA] Implement linear algorithm for the isRecursivelyLCSSAForm
For each block check that it doesn't have any uses outside of it's innermost loop.
Differential Revision: https://reviews.llvm.org/D25364
llvm-svn: 283877
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index 36e2fea63dc..89933e0f574 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -366,7 +366,7 @@ static Loop *separateNestedLoop(Loop *L, BasicBlock *Preheader, // already be a use of an LCSSA phi node. formLCSSA(*L, *DT, LI, SE); - assert(NewOuter->isRecursivelyLCSSAForm(*DT) && + assert(NewOuter->isRecursivelyLCSSAForm(*DT, *LI) && "LCSSA is broken after separating nested loops!"); } @@ -810,8 +810,8 @@ bool LoopSimplify::runOnFunction(Function &F) { if (PreserveLCSSA) { assert(DT && "DT not available."); assert(LI && "LI not available."); - bool InLCSSA = - all_of(*LI, [&](Loop *L) { return L->isRecursivelyLCSSAForm(*DT); }); + bool InLCSSA = all_of( + *LI, [&](Loop *L) { return L->isRecursivelyLCSSAForm(*DT, *LI); }); assert(InLCSSA && "Requested to preserve LCSSA, but it's already broken."); } #endif @@ -822,8 +822,8 @@ bool LoopSimplify::runOnFunction(Function &F) { #ifndef NDEBUG if (PreserveLCSSA) { - bool InLCSSA = - all_of(*LI, [&](Loop *L) { return L->isRecursivelyLCSSAForm(*DT); }); + bool InLCSSA = all_of( + *LI, [&](Loop *L) { return L->isRecursivelyLCSSAForm(*DT, *LI); }); assert(InLCSSA && "LCSSA is broken after loop-simplify."); } #endif |