This patch fixes a bug that allowed vectorizing of loops with loads and
stores having indexing functions varying along different memory
dimensions.
Details
Diff Detail
Event Timeline
mlir/lib/Analysis/LoopAnalysis.cpp | ||
---|---|---|
343 | note that we have a subtle difference of not setting memRefDim for -1 after this change; | |
mlir/test/Dialect/Affine/SuperVectorize/vectorize_1d.mlir | ||
402 | can you please indent the CHECKs that are inside the method body? |
- Set *memRefDim to -1 in the beginning
- Fix indentation for the test case
mlir/lib/Analysis/LoopAnalysis.cpp | ||
---|---|---|
343 | I think that if we have some memory ops that are invariant along the induction variable and some ops that vary along the same memory dimension N, then we should write N to *memRefDim. So we cannot write -1 to *memRefDim if isContiguousAccess returned -1, otherwise we may overwrite N. |
Thanks for fixing this, Sergei! LGTM. I'll leave the final approval to Aart or Nicolas.
note that we have a subtle difference of not setting memRefDim for -1 after this change;
that is probably harmless, but perhaps you want this out of the if to preserve behavior?