[RS4GC] Lazily set changed flag when folding single entry phis
The function FoldSingleEntryPHINodes() is changed to return if it has changed IR or not. This return value is used by RS4GC to set the MadeChange flag respectively. Reviewed By: reames Differential Revision: https://reviews.llvm.org/D93810
This commit is contained in:
@@ -136,9 +136,10 @@ bool llvm::EliminateUnreachableBlocks(Function &F, DomTreeUpdater *DTU,
|
||||
return !DeadBlocks.empty();
|
||||
}
|
||||
|
||||
void llvm::FoldSingleEntryPHINodes(BasicBlock *BB,
|
||||
bool llvm::FoldSingleEntryPHINodes(BasicBlock *BB,
|
||||
MemoryDependenceResults *MemDep) {
|
||||
if (!isa<PHINode>(BB->begin())) return;
|
||||
if (!isa<PHINode>(BB->begin()))
|
||||
return false;
|
||||
|
||||
while (PHINode *PN = dyn_cast<PHINode>(BB->begin())) {
|
||||
if (PN->getIncomingValue(0) != PN)
|
||||
@@ -151,6 +152,7 @@ void llvm::FoldSingleEntryPHINodes(BasicBlock *BB,
|
||||
|
||||
PN->eraseFromParent();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool llvm::DeleteDeadPHIs(BasicBlock *BB, const TargetLibraryInfo *TLI,
|
||||
|
||||
Reference in New Issue
Block a user