Update collectLoopUniforms to identify uniform pointers using
Legal::isUniform. This is more powerful and brings pointer
classification here in sync with setCostBasedWideningDecision
which uses isUniformMemOp. The existing mis-match in reasoning
can causes crashes due to D134460, which is fixed by this patch.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Good catch!
Thinking if this may call for an alternative fix within isVectorizedMemAccessUse(), which admittedly does not affect AArch64/sve-inv-store.ll(?)
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | ||
---|---|---|
4703–4704 | How about the above alternative change? Seems more inline with isVectorizedMemAccessUse's documentation. if (isa<StoreInst>(I) && I->getOperand(0) == Ptr) return false; | |
4753 | This assert is currently redundant, and needs to be dropped (along with {}) in the alternative fix above. | |
llvm/test/Transforms/LoopVectorize/AArch64/sve-inv-store.ll | ||
173 ↗ | (On Diff #523907) | note: store to invariant address: insert-element - extract-element redundancy elimination |
llvm/test/Transforms/LoopVectorize/skeleton-lcssa-crash.ll | ||
54–55 | note: store to invariant address - store-after-store redundancy elimination. |
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | ||
---|---|---|
4703–4704 | Thanks, updated to use the alternative fix. Early exit added in b75086210774 | |
4753 | Updated, thanks! |
How about the above alternative change? Seems more inline with isVectorizedMemAccessUse's documentation.
While we're here, an early exit seems simpler: