1
0
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:
Andrew Kaylor 2018-03-23 17:36:18 +00:00
parent a63fa9f9be
commit 2331dc51e0

View File

@ -893,8 +893,14 @@ static void splitPredecessorsOfLoopExit(PHINode *PN, DominatorTree *DT,
// Since we do not allow splitting EH-block with BlockColors in
// canSplitPredecessors(), we can simply assign predecessor's color to
// the new block.
if (!BlockColors.empty())
BlockColors[NewPred] = BlockColors[PredBB];
if (!BlockColors.empty()) {
// 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);
}