[PATCH] D22778: Add Loop Sink pass to reverse the LICM based of basic block frequency.

David Li via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 10:42:32 PDT 2016


davidxl added inline comments.

================
Comment at: lib/Transforms/Scalar/LoopSink.cpp:91
@@ +90,3 @@
+  // Loads have extra constraints we have to verify before we can sink them.
+  if (LoadInst *LI = dyn_cast<LoadInst>(&I)) {
+    if (!LI->isUnordered())
----------------
Same here -- please share the utility with LICM (isHoistableLoad)

================
Comment at: lib/Transforms/Scalar/LoopSink.cpp:114
@@ +113,3 @@
+
+  // Only these instructions are sinkable.
+  if (!isa<BinaryOperator>(I) && !isa<CastInst>(I) && !isa<SelectInst>(I) &&
----------------
This code is shared with LICM, can this code be refactored into some utillty (declared in LICM.h) helper?


https://reviews.llvm.org/D22778





More information about the llvm-commits mailing list