[llvm] [polly] [SCEV] Introduce SDiv expressions (PR #216862)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 02:48:50 PDT 2026
artagnon wrote:
> I wonder if a more targeted approach (e.g., directly extending the stride computation to handle signed division) might well work better.
Perhaps I can explain a bit better: we currently speculate a stride as `SCEVUnknown = SCEVConstant(1)` (which is a specific case of `SCEVUnknown = sdiv(StrideAPConstant, LoadStoreSz)`, and add this as a stride predicate for the vectorizer to materialize in the pre-header as a guard before entering the vector-loop? We would ideally want `SCEVUnknown = SCEVSDiv(StrideExprSCEV, SCEVConstant(LoadStoreSz))` to be the speculation? Creating an out-of-band SDiv expression, extending SCEVPredicate and Expander to handle this new out-of-band expression seemed like a bit of a hack, and I thought this approach was cleaner? Can you suggest a better way?
https://github.com/llvm/llvm-project/pull/216862
More information about the llvm-commits
mailing list