[PATCH] D50696: [NFC][LICM] Make hoist method void

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 14 19:49:54 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL339750: [NFC][LICM] Make hoist method void (authored by mkazantsev, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D50696?vs=160543&id=160744#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D50696

Files:
  llvm/trunk/lib/Transforms/Scalar/LICM.cpp


Index: llvm/trunk/lib/Transforms/Scalar/LICM.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/LICM.cpp
+++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp
@@ -93,7 +93,7 @@
 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 @@
            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 @@
 /// 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 @@
   else if (isa<CallInst>(I))
     ++NumMovedCalls;
   ++NumHoisted;
-  return true;
 }
 
 /// Only sink or hoist an instruction if it is not a trapping instruction,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50696.160744.patch
Type: text/x-patch
Size: 1811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180815/b4337290/attachment.bin>


More information about the llvm-commits mailing list