[llvm] LAA: refine condition for invariant stores (PR #124567)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 27 08:00:58 PST 2025
================
@@ -2545,7 +2545,8 @@ bool LoopAccessInfo::analyzeLoop(AAResults *AA, const LoopInfo *LI,
for (StoreInst *ST : Stores) {
Value *Ptr = ST->getPointerOperand();
- if (isInvariant(Ptr)) {
+ const SCEV *PtrScev = replaceSymbolicStrideSCEV(*PSE, SymbolicStrides, Ptr);
----------------
david-arm wrote:
The commit message says `use the information to refine the loop-invariant check`, but I can't think of any scenario where requiring a stride of 1 for the pointer would result in a different answer from `isLoopInvariant`. Prior to your change, when using a store pointer with a symbolic stride `isInvariant` would surely return false? With this patch applied the answer will still be false because now we know the stride is 1.
https://github.com/llvm/llvm-project/pull/124567
More information about the llvm-commits
mailing list