This patch extends the vector.extract(vector.transfer_read) -> scalar
load patterns to support vector.transfer_read with multiple uses. For
now, we check that all the uses are vector.extract operations.
Supporting multiple uses is predicated under a flag.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm curious that is there a case we want to disable the flag? Why it is not enabled by default?
mlir/include/mlir/Dialect/Vector/Transforms/LoweringPatterns.h | ||
---|---|---|
120 | can we add a doc about what it means if allowMultipleUses is enabled and is disabled? | |
mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp | ||
590–591 | I think this can be merged into one isa? | |
669–670 | There are same checks in other pattern. Can we refactor them to a common method? |
Great feedback! Thanks!
I'm curious that is there a case we want to disable the flag? Why it is not enabled by default?
The original comment says "xfer result must have a single use. Otherwise, it may be better to perform a vector load.". Not sure what the context is. Perhaps if there are scalar and vector uses... or if the cache line is evicted before all the scalar loads are completed (weird)...
In any case, I think it's better to preserve the original behavior for now until we can learn more about it.
mlir/include/mlir/Dialect/Vector/Transforms/LoweringPatterns.h | ||
---|---|---|
115–117 | Sorry, it's a bit late at my end, so perhaps I'm misreading this myself :) Please double-check. |
mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp | ||
---|---|---|
612 | IIUC, this method will rewrite unconditionally. But match will not match unconditionally. Put differently - this comment needs updating, right? |
Thanks! Updating doc and landing. Let me know if there are any other doc issues. I'll be happy to address them separately.
mlir/include/mlir/Dialect/Vector/Transforms/LoweringPatterns.h | ||
---|---|---|
115–117 | Thanks! It looks like it was also late at my end when I wrote that :) | |
mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp | ||
612 | Updated doc, thanks! |
Sorry, it's a bit late at my end, so perhaps I'm misreading this myself :) Please double-check.