mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 07:17:36 +00:00
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224740 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user