[llvm] [mlir][vector] Enable transfer op hoisting with dynamic indices (PR #68500)

Lei Zhang via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 15 16:35:09 PDT 2023


================
@@ -105,16 +105,23 @@ bool checkSameValueRAW(TransferWriteOp defWrite, TransferReadOp read);
 /// op.
 bool checkSameValueWAW(TransferWriteOp write, TransferWriteOp priorWrite);
 
-/// Same behavior as `isDisjointTransferSet` but doesn't require the operations
-/// to have the same tensor/memref. This allows comparing operations accessing
-/// different tensors.
+/// Return true if we can prove that the transfer operations access disjoint
+/// memory, without requring the accessed tensor/memref to be the same.
+///
+/// If `testDynamicValueUsingBounds` is true, tries to test dynamic values
+/// via ValueBoundsOpInterface.
 bool isDisjointTransferIndices(VectorTransferOpInterface transferA,
-                               VectorTransferOpInterface transferB);
+                               VectorTransferOpInterface transferB,
+                               bool testDynamicValueUsingBounds = false);
----------------
antiagainst wrote:

I'm a bit unclear of how expensive these value bounds analyses are. This function is also used in `foldRAW`/`foldWaw` which are part of the op folders that are run everywhere. Don't want to introduce the computation overhead to those op folders. We can drop this if you think it's fine there!

https://github.com/llvm/llvm-project/pull/68500


More information about the llvm-commits mailing list