We stored static (int) and dynamic (Value) iteration space dims separately
and then merged them by creating constant ops for the static ones. This
merge happened multiple times during vectorization. This PR changes that
to perform the merge once and store in the state instead of the dynamic
values in isolation.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for the clean-up, makes sense! Just a couple minor comments, otherwise LGTM!
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp | ||
---|---|---|
199–203 | Why arith.constant_index rather than arith.constant? Also, I see that you use the term "value sizes", but aren't these "(static and dynamic) dim sizes" instead? Probably just my limited understanding, but "Value" to me is an implementation detail (IIUC, "Value" in this context means "mlir::Value" corresponding to either arith.constant or tensor.dim Ops). Naming is hard 😂 . | |
294–295 | Forgot to update this comment? |
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp | ||
---|---|---|
199–203 | Good catch! I thought we were also printing the ConstantIndex especialization as arith.constant_index. That's not the case. Fixed. I'm remarking Value here because static dim sizes are also stored as int64_t elements by this class so this method is actually generating arith.constant ops for them (and tensor.dim for dynamic sizes). |
Why arith.constant_index rather than arith.constant?
Also, I see that you use the term "value sizes", but aren't these "(static and dynamic) dim sizes" instead? Probably just my limited understanding, but "Value" to me is an implementation detail (IIUC, "Value" in this context means "mlir::Value" corresponding to either arith.constant or tensor.dim Ops).
Naming is hard 😂 .