diff options
| author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2014-12-22 22:35:46 +0000 |
|---|---|---|
| committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2014-12-22 22:35:46 +0000 |
| commit | bad65c3b708accec8c6e85346dabc7967cb3d7ca (patch) | |
| tree | 859975d0c73e10979f445919d266492d4b42617d /llvm/lib/Transforms/Scalar/LICM.cpp | |
| parent | a47ace59019721411307ab06eea5b7796cb3dd3e (diff) | |
| download | bcm5719-llvm-bad65c3b708accec8c6e85346dabc7967cb3d7ca.tar.gz bcm5719-llvm-bad65c3b708accec8c6e85346dabc7967cb3d7ca.zip | |
[LCSSA] Handle PHI insertion in disjoint loops
Take two disjoint Loops L1 and L2.
LoopSimplify fails to simplify some loops (e.g. when indirect branches
are involved). In such situations, it can happen that an exit for L1 is
the header of L2. Thus, when we create PHIs in one of such exits we are
also inserting PHIs in L2 header.
This could break LCSSA form for L2 because these inserted PHIs can also
have uses in L2 exits, which are never handled in the current
implementation. Provide a fix for this corner case and test that we
don't assert/crash on that.
Differential Revision: http://reviews.llvm.org/D6624
rdar://problem/19166231
llvm-svn: 224740
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LICM.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index 99725b5f738..f07158a6cb1 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -316,7 +316,8 @@ bool LICM::runOnLoop(Loop *L, LPPassManager &LPM) { // SSAUpdater strategy during promotion that was LCSSA aware and reformed // it as it went. if (Changed) - formLCSSARecursively(*L, *DT, getAnalysisIfAvailable<ScalarEvolution>()); + formLCSSARecursively(*L, *DT, LI, + getAnalysisIfAvailable<ScalarEvolution>()); } // Check that neither this loop nor its parent have had LCSSA broken. LICM is |

