[llvm] r339750 - [NFC][LICM] Make hoist method void
Max Kazantsev via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 14 19:49:12 PDT 2018
Author: mkazantsev
Date: Tue Aug 14 19:49:12 2018
New Revision: 339750
URL: http://llvm.org/viewvc/llvm-project?rev=339750&view=rev
Log:
[NFC][LICM] Make hoist method void
Method hoist always returns true. This patch makes it void.
Differential Revision: https://reviews.llvm.org/D50696
Reviewed By: hiraditya
Modified:
llvm/trunk/lib/Transforms/Scalar/LICM.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=339750&r1=339749&r2=339750&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Tue Aug 14 19:49:12 2018
@@ -93,7 +93,7 @@ static bool inSubLoop(BasicBlock *BB, Lo
static bool isNotUsedOrFreeInLoop(const Instruction &I, const Loop *CurLoop,
const LoopSafetyInfo *SafetyInfo,
TargetTransformInfo *TTI, bool &FreeInLoop);
-static bool hoist(Instruction &I, const DominatorTree *DT, const Loop *CurLoop,
+static void hoist(Instruction &I, const DominatorTree *DT, const Loop *CurLoop,
const LoopSafetyInfo *SafetyInfo,
OptimizationRemarkEmitter *ORE);
static bool sink(Instruction &I, LoopInfo *LI, DominatorTree *DT,
@@ -487,7 +487,8 @@ bool llvm::hoistRegion(DomTreeNode *N, A
isSafeToExecuteUnconditionally(
I, DT, CurLoop, SafetyInfo, ORE,
CurLoop->getLoopPreheader()->getTerminator()))) {
- Changed |= hoist(I, DT, CurLoop, SafetyInfo, ORE);
+ hoist(I, DT, CurLoop, SafetyInfo, ORE);
+ Changed = true;
continue;
}
@@ -1063,7 +1064,7 @@ static bool sink(Instruction &I, LoopInf
/// When an instruction is found to only use loop invariant operands that
/// is safe to hoist, this instruction is called to do the dirty work.
///
-static bool hoist(Instruction &I, const DominatorTree *DT, const Loop *CurLoop,
+static void hoist(Instruction &I, const DominatorTree *DT, const Loop *CurLoop,
const LoopSafetyInfo *SafetyInfo,
OptimizationRemarkEmitter *ORE) {
auto *Preheader = CurLoop->getLoopPreheader();
@@ -1101,7 +1102,6 @@ static bool hoist(Instruction &I, const
else if (isa<CallInst>(I))
++NumMovedCalls;
++NumHoisted;
- return true;
}
/// Only sink or hoist an instruction if it is not a trapping instruction,
More information about the llvm-commits
mailing list