s/UpdateDT/ModifiedDT/g

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128211 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2011-03-24 15:35:25 +00:00
parent a2e0762fae
commit 52e37df8c0

View File

@ -81,9 +81,9 @@ namespace {
/// multiple load/stores of the same address. /// multiple load/stores of the same address.
DenseMap<Value*, Value*> SunkAddrs; DenseMap<Value*, Value*> SunkAddrs;
/// UpdateDT - If CFG is modified in anyway, dominator tree may need to /// ModifiedDT - If CFG is modified in anyway, dominator tree may need to
/// be updated. /// be updated.
bool UpdateDT; bool ModifiedDT;
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
@ -124,7 +124,7 @@ FunctionPass *llvm::createCodeGenPreparePass(const TargetLowering *TLI) {
bool CodeGenPrepare::runOnFunction(Function &F) { bool CodeGenPrepare::runOnFunction(Function &F) {
bool EverMadeChange = false; bool EverMadeChange = false;
UpdateDT = false; ModifiedDT = false;
DT = getAnalysisIfAvailable<DominatorTree>(); DT = getAnalysisIfAvailable<DominatorTree>();
PFI = getAnalysisIfAvailable<ProfileInfo>(); PFI = getAnalysisIfAvailable<ProfileInfo>();
@ -150,11 +150,11 @@ bool CodeGenPrepare::runOnFunction(Function &F) {
MadeChange |= ConstantFoldTerminator(BB); MadeChange |= ConstantFoldTerminator(BB);
if (MadeChange) if (MadeChange)
UpdateDT = true; ModifiedDT = true;
EverMadeChange |= MadeChange; EverMadeChange |= MadeChange;
} }
if (UpdateDT && DT) if (ModifiedDT && DT)
DT->DT->recalculate(F); DT->DT->recalculate(F);
return EverMadeChange; return EverMadeChange;
@ -331,7 +331,7 @@ void CodeGenPrepare::EliminateMostlyEmptyBlock(BasicBlock *BB) {
// The PHIs are now updated, change everything that refers to BB to use // The PHIs are now updated, change everything that refers to BB to use
// DestBB and remove BB. // DestBB and remove BB.
BB->replaceAllUsesWith(DestBB); BB->replaceAllUsesWith(DestBB);
if (DT && !UpdateDT) { if (DT && !ModifiedDT) {
BasicBlock *BBIDom = DT->getNode(BB)->getIDom()->getBlock(); BasicBlock *BBIDom = DT->getNode(BB)->getIDom()->getBlock();
BasicBlock *DestBBIDom = DT->getNode(DestBB)->getIDom()->getBlock(); BasicBlock *DestBBIDom = DT->getNode(DestBB)->getIDom()->getBlock();
BasicBlock *NewIDom = DT->findNearestCommonDominator(BBIDom, DestBBIDom); BasicBlock *NewIDom = DT->findNearestCommonDominator(BBIDom, DestBBIDom);
@ -535,7 +535,7 @@ bool CodeGenPrepare::OptimizeCallInst(CallInst *CI) {
WeakVH IterHandle(CurInstIterator); WeakVH IterHandle(CurInstIterator);
ReplaceAndSimplifyAllUses(CI, RetVal, TLI ? TLI->getTargetData() : 0, ReplaceAndSimplifyAllUses(CI, RetVal, TLI ? TLI->getTargetData() : 0,
UpdateDT ? 0 : DT); ModifiedDT ? 0 : DT);
// If the iterator instruction was recursively deleted, start over at the // If the iterator instruction was recursively deleted, start over at the
// start of the block. // start of the block.
@ -669,7 +669,7 @@ bool CodeGenPrepare::DupRetToEnableTailCallOpts(ReturnInst *RI) {
// Duplicate the return into CallBB. // Duplicate the return into CallBB.
(void)FoldReturnIntoUncondBranch(RI, BB, CallBB); (void)FoldReturnIntoUncondBranch(RI, BB, CallBB);
UpdateDT = Changed = true; ModifiedDT = Changed = true;
++NumRetsDup; ++NumRetsDup;
} }