[PATCH] D113656: [LICM] Check a heuristic case to hoist load
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 11 02:26:37 PST 2021
fhahn added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2407
+ // ; MemoryUse(2) MayAlias
+ // %0 = load i32**, i32*** @a, align 8, !tbaa !8
+ // %idxprom = zext i32 %i.0 to i64
----------------
is `!tbaa` required here?
Also, would it be possible that `@a` contains the address of `@a` before we enter the loop? Could the first store in the loop modify `@a` that way?
================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2466
+ auto *PtrDiffSCEV = SE->getMinusSCEV(StorePtrSCEV, LoadSCEV);
+ if (dyn_cast<SCEVAddRecExpr>(PtrDiffSCEV))
+ return false;
----------------
is this sufficient? An addrec could have an unknown step I think, which could be 0.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113656/new/
https://reviews.llvm.org/D113656
More information about the llvm-commits
mailing list