diff options
| author | Michael Zolotukhin <mzolotukhin@apple.com> | 2016-08-07 01:56:54 +0000 | 
|---|---|---|
| committer | Michael Zolotukhin <mzolotukhin@apple.com> | 2016-08-07 01:56:54 +0000 | 
| commit | 442b82f0ebeaa33e9ab705a4328c0dac89abbdd8 (patch) | |
| tree | 04d5ea45b501869d738a65a8958468a2693fe5f0 /llvm/lib/Transforms | |
| parent | 4679644c53a15fc01491f6025c3419aebfa0887d (diff) | |
| download | bcm5719-llvm-442b82f0ebeaa33e9ab705a4328c0dac89abbdd8.tar.gz bcm5719-llvm-442b82f0ebeaa33e9ab705a4328c0dac89abbdd8.zip | |
Revert "Revert "[LoopSimplify] Fix updating LCSSA after separating nested loops.""
This reverts commit r277901. Reaaply the commit as it looks like it has
nothing to do with the bots failures.
llvm-svn: 277946
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 15 | 
1 files changed, 15 insertions, 0 deletions
| diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index 2846e8f235b..fc5781fdf30 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -376,6 +376,21 @@ static Loop *separateNestedLoop(Loop *L, BasicBlock *Preheader,          }        }      } +    // We also need to check exit blocks of the outer loop - it might be using +    // values from what now became an inner loop. +    SmallVector<BasicBlock*, 8> ExitBlocks; +    NewOuter->getExitBlocks(ExitBlocks); +    for (BasicBlock *ExitBB: ExitBlocks) { +      for (Instruction &I : *ExitBB) { +        for (Value *Op : I.operands()) { +          Instruction *OpI = dyn_cast<Instruction>(Op); +          if (!OpI || !L->contains(OpI)) +            continue; +          WorklistSet.insert(OpI); +        } +      } +    } +      SmallVector<Instruction *, 8> Worklist(WorklistSet.begin(),                                             WorklistSet.end());      formLCSSAForInstructions(Worklist, *DT, *LI); | 

