From 00ebfcda429c9220f84fb54620b08906089a566f Mon Sep 17 00:00:00 2001 From: Alina Sbirlea Date: Mon, 2 Jul 2018 18:53:40 +0000 Subject: [PATCH] Replace "Replacable" with "Replaceable". [NFC] llvm-svn: 336133 --- lib/Transforms/Scalar/LICM.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index 10f386064f9..ff66632f039 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -690,7 +690,7 @@ bool llvm::canSinkOrHoistInst(Instruction &I, AAResults *AA, DominatorTree *DT, /// This is true when all incoming values are that instruction. /// This pattern occurs most often with LCSSA PHI nodes. /// -static bool isTriviallyReplacablePHI(const PHINode &PN, const Instruction &I) { +static bool isTriviallyReplaceablePHI(const PHINode &PN, const Instruction &I) { for (const Value *IncValue : PN.incoming_values()) if (IncValue != &I) return false; @@ -820,12 +820,12 @@ CloneInstructionInExitBlock(Instruction &I, BasicBlock &ExitBlock, PHINode &PN, return New; } -static Instruction *sinkThroughTriviallyReplacablePHI( +static Instruction *sinkThroughTriviallyReplaceablePHI( PHINode *TPN, Instruction *I, LoopInfo *LI, SmallDenseMap &SunkCopies, const LoopSafetyInfo *SafetyInfo, const Loop *CurLoop) { - assert(isTriviallyReplacablePHI(*TPN, *I) && - "Expect only trivially replacalbe PHI"); + assert(isTriviallyReplaceablePHI(*TPN, *I) && + "Expect only trivially replaceable PHI"); BasicBlock *ExitBlock = TPN->getParent(); Instruction *New; auto It = SunkCopies.find(ExitBlock); @@ -868,7 +868,7 @@ static void splitPredecessorsOfLoopExit(PHINode *PN, DominatorTree *DT, assert(ExitBlockSet.count(ExitBB) && "Expect the PHI is in an exit block."); // Split predecessors of the loop exit to make instructions in the loop are - // exposed to exit blocks through trivially replacable PHIs while keeping the + // exposed to exit blocks through trivially replaceable PHIs while keeping the // loop in the canonical form where each predecessor of each exit block should // be contained within the loop. For example, this will convert the loop below // from @@ -880,7 +880,7 @@ static void splitPredecessorsOfLoopExit(PHINode *PN, DominatorTree *DT, // %v2 = // br %LE, %LB1 // LE: - // %p = phi [%v1, %LB1], [%v2, %LB2] <-- non-trivially replacable + // %p = phi [%v1, %LB1], [%v2, %LB2] <-- non-trivially replaceable // // to // @@ -891,10 +891,10 @@ static void splitPredecessorsOfLoopExit(PHINode *PN, DominatorTree *DT, // %v2 = // br %LE.split2, %LB1 // LE.split: - // %p1 = phi [%v1, %LB1] <-- trivially replacable + // %p1 = phi [%v1, %LB1] <-- trivially replaceable // br %LE // LE.split2: - // %p2 = phi [%v2, %LB2] <-- trivially replacable + // %p2 = phi [%v2, %LB2] <-- trivially replaceable // br %LE // LE: // %p = phi [%p1, %LE.split], [%p2, %LE.split2] @@ -975,14 +975,14 @@ static bool sink(Instruction &I, LoopInfo *LI, DominatorTree *DT, } VisitedUsers.insert(PN); - if (isTriviallyReplacablePHI(*PN, I)) + if (isTriviallyReplaceablePHI(*PN, I)) continue; if (!canSplitPredecessors(PN, SafetyInfo)) return Changed; // Split predecessors of the PHI so that we can make users trivially - // replacable. + // replaceable. splitPredecessorsOfLoopExit(PN, DT, LI, CurLoop, SafetyInfo); // Should rebuild the iterators, as they may be invalidated by @@ -1017,9 +1017,9 @@ static bool sink(Instruction &I, LoopInfo *LI, DominatorTree *DT, PHINode *PN = cast(User); assert(ExitBlockSet.count(PN->getParent()) && "The LCSSA PHI is not in an exit block!"); - // The PHI must be trivially replacable. - Instruction *New = sinkThroughTriviallyReplacablePHI(PN, &I, LI, SunkCopies, - SafetyInfo, CurLoop); + // The PHI must be trivially replaceable. + Instruction *New = sinkThroughTriviallyReplaceablePHI(PN, &I, LI, SunkCopies, + SafetyInfo, CurLoop); PN->replaceAllUsesWith(New); PN->eraseFromParent(); Changed = true;