mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
When UpdateDT is set, DT is invalid, which could cause problems when trying to
use it later. I couldn't make a test that hits this with the current code. llvm-svn: 128195
This commit is contained in:
parent
6633f15fad
commit
6862665125
@ -331,7 +331,7 @@ void CodeGenPrepare::EliminateMostlyEmptyBlock(BasicBlock *BB) {
|
||||
// The PHIs are now updated, change everything that refers to BB to use
|
||||
// DestBB and remove BB.
|
||||
BB->replaceAllUsesWith(DestBB);
|
||||
if (DT) {
|
||||
if (DT && !UpdateDT) {
|
||||
BasicBlock *BBIDom = DT->getNode(BB)->getIDom()->getBlock();
|
||||
BasicBlock *DestBBIDom = DT->getNode(DestBB)->getIDom()->getBlock();
|
||||
BasicBlock *NewIDom = DT->findNearestCommonDominator(BBIDom, DestBBIDom);
|
||||
@ -534,7 +534,8 @@ bool CodeGenPrepare::OptimizeCallInst(CallInst *CI) {
|
||||
// happens.
|
||||
WeakVH IterHandle(CurInstIterator);
|
||||
|
||||
ReplaceAndSimplifyAllUses(CI, RetVal, TLI ? TLI->getTargetData() : 0, DT);
|
||||
ReplaceAndSimplifyAllUses(CI, RetVal, TLI ? TLI->getTargetData() : 0,
|
||||
UpdateDT ? 0 : DT);
|
||||
|
||||
// If the iterator instruction was recursively deleted, start over at the
|
||||
// start of the block.
|
||||
|
Loading…
x
Reference in New Issue
Block a user