Vector transfer ops semantic is extended to allow specifying a per-dimension masked
attribute. When the attribute is false on a particular dimension, lowering to LLVM emits
unmasked load and store operations.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/Vector/VectorOps.td | ||
---|---|---|
1124 | The comment looks wrong given that the builder takes a permutationMap | |
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp | ||
773 | I wonder if we actually need template specialization here, or just overloading the function on the operation type would have sufficed? | |
mlir/lib/Dialect/Vector/VectorOps.cpp | ||
1305 | It's already an ArrayAttr, no need to cast | |
1308 | Nit: "requires optional" sounds weird to me. "expects the optional 'masked' attr to be of <...> rank when present"? | |
1357 | Isn't it already an ArrayAttr? In any case, I think you should just cast because the verifier ensures it's an array attribute. |
Thanks, Nicolas! It looks good! Just a minor comment below.
This patch introduces an attribute to set if a vector load/store is masked but how is that mask being computed/passed to the vector load/store?
IIUC, the current implementation assumes that there is no divergent control flow and therefore the loop exit condition can be used as mask for all the vector loads/stores, is that correct?
mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir | ||
---|---|---|
923 | I think we should make padding optional and avoid it when masked is false. It doesn't make sense, right? |
The comment looks wrong given that the builder takes a permutationMap