[PATCH] D27939: [LICM] Report failing to hoist a load with an invariant address

Adam Nemet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 11:08:41 PST 2017


anemet added inline comments.


================
Comment at: lib/Transforms/Scalar/LICM.cpp:477
+        pointerInvalidatedByLoop(LI->getOperand(0), Size, AAInfo, CurAST);
+    if (ORE && Invalidated && CurLoop->isLoopInvariant(LI->getPointerOperand()))
+      ORE->emit(OptimizationRemarkMissed(
----------------
hfinkel wrote:
> Can we hoist a load without a loop-invariant address? It seems like we shouldn't be making aliasing queries for loads we can't possibly hoist, and so I don't understand why we specifically need the `CurLoop->isLoopInvariant` check here.
No, you're right.  The call to this is guarded with hasLoopInvariantOperands.


https://reviews.llvm.org/D27939





More information about the llvm-commits mailing list