[PATCH] D37076: [LICM] Allow sinking when foldable in loop
Jun Bum Lim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 25 08:50:36 PDT 2017
junbuml added inline comments.
================
Comment at: lib/Transforms/Scalar/LICM.cpp:713
+ const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I);
+ if (GEP && isa<LoadInst>(UserI) && (I->getParent() == UserI->getParent())) {
+ SmallVector<const Value *, 4> Indices;
----------------
bmakam wrote:
> Do we need to check I->getParent() == UserI->getParent()? We already check if CurLoop->contains(UserI) right?
Even in the same loop, if they are in different blocks, the current ISel may not fold the GEP into the load.
https://reviews.llvm.org/D37076
More information about the llvm-commits
mailing list