[PATCH] D27940: [LICM] Report failing to hoist conditionally-executed loads

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 8 12:58:56 PST 2017


hfinkel added a comment.

This is a great idea! Users are very often unaware of this complication.



================
Comment at: lib/Transforms/Scalar/LICM.cpp:797
+    auto *LI = dyn_cast<LoadInst>(&Inst);
+    if (LI && CurLoop->isLoopInvariant(LI->getPointerOperand()))
+      ORE->emit(OptimizationRemarkMissed(
----------------
I have the same question here as I did in D27939, is the `CurLoop->isLoopInvariant` check needed here? At least in the call on line 407, the call is guarded by `CurLoop->hasLoopInvariantOperands`.


https://reviews.llvm.org/D27940





More information about the llvm-commits mailing list