mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
Fix a block copying problem in LICM
Differential Revision: https://reviews.llvm.org/D44817 llvm-svn: 328336
This commit is contained in:
parent
a63fa9f9be
commit
2331dc51e0
@ -893,8 +893,14 @@ static void splitPredecessorsOfLoopExit(PHINode *PN, DominatorTree *DT,
|
|||||||
// Since we do not allow splitting EH-block with BlockColors in
|
// Since we do not allow splitting EH-block with BlockColors in
|
||||||
// canSplitPredecessors(), we can simply assign predecessor's color to
|
// canSplitPredecessors(), we can simply assign predecessor's color to
|
||||||
// the new block.
|
// the new block.
|
||||||
if (!BlockColors.empty())
|
if (!BlockColors.empty()) {
|
||||||
BlockColors[NewPred] = BlockColors[PredBB];
|
// Grab a reference to the ColorVector to be inserted before getting the
|
||||||
|
// reference to the vector we are copying because inserting the new
|
||||||
|
// element in BlockColors might cause the map to be reallocated.
|
||||||
|
ColorVector &ColorsForNewBlock = BlockColors[NewPred];
|
||||||
|
ColorVector &ColorsForOldBlock = BlockColors[PredBB];
|
||||||
|
ColorsForNewBlock = ColorsForOldBlock;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PredBBs.remove(PredBB);
|
PredBBs.remove(PredBB);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user