@@ -69,19 +69,19 @@ class LoopRotate {
6969 bool RotationOnly;
7070 bool IsUtilMode;
7171 bool PrepareForLTO;
72- function_ref< bool (Loop *, ScalarEvolution *)> ProfitabilityCheck ;
72+ bool ForceRotation ;
7373
7474public:
7575 LoopRotate (unsigned MaxHeaderSize, LoopInfo *LI,
7676 const TargetTransformInfo *TTI, AssumptionCache *AC,
7777 DominatorTree *DT, ScalarEvolution *SE, MemorySSAUpdater *MSSAU,
7878 const SimplifyQuery &SQ, bool RotationOnly, bool IsUtilMode,
7979 bool PrepareForLTO,
80- function_ref< bool (Loop *, ScalarEvolution *)> ProfitabilityCheck )
80+ bool ForceRotation )
8181 : MaxHeaderSize(MaxHeaderSize), LI(LI), TTI(TTI), AC(AC), DT(DT), SE(SE),
8282 MSSAU (MSSAU), SQ(SQ), RotationOnly(RotationOnly),
8383 IsUtilMode(IsUtilMode), PrepareForLTO(PrepareForLTO),
84- ProfitabilityCheck(ProfitabilityCheck ) {}
84+ ForceRotation(ForceRotation ) {}
8585 bool processLoop (Loop *L);
8686
8787private:
@@ -445,7 +445,7 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
445445 // latch was just simplified. Or if we think it will be profitable.
446446 if (L->isLoopExiting (OrigLatch) && !SimplifiedLatch &&
447447 IsUtilMode == false && !profitableToRotateLoopExitingLatch (L) &&
448- !canRotateDeoptimizingLatchExit (L) && !ProfitabilityCheck (L, SE) )
448+ !canRotateDeoptimizingLatchExit (L) && !ForceRotation )
449449 return Rotated;
450450
451451 // Check size of original header and reject loop if it is very big or we can't
@@ -1061,9 +1061,8 @@ bool llvm::LoopRotation(
10611061 DominatorTree *DT, ScalarEvolution *SE, MemorySSAUpdater *MSSAU,
10621062 const SimplifyQuery &SQ, bool RotationOnly = true ,
10631063 unsigned Threshold = unsigned (-1 ), bool IsUtilMode = true,
1064- bool PrepareForLTO,
1065- function_ref<bool(Loop *, ScalarEvolution *)> ProfitabilityCheck) {
1064+ bool PrepareForLTO, bool ForceRotation) {
10661065 LoopRotate LR (Threshold, LI, TTI, AC, DT, SE, MSSAU, SQ, RotationOnly,
1067- IsUtilMode, PrepareForLTO, ProfitabilityCheck );
1066+ IsUtilMode, PrepareForLTO, ForceRotation );
10681067 return LR.processLoop (L);
10691068}
0 commit comments