[Mlir-commits] [mlir] [mlir][vector] Make the in_bounds attribute mandatory (PR #97049)

Andrzej WarzyƄski llvmlistbot at llvm.org
Fri Jul 12 00:23:17 PDT 2024


================
@@ -155,6 +155,13 @@ class AffineMap {
   bool isMinorIdentityWithBroadcasting(
       SmallVectorImpl<unsigned> *broadcastedDims = nullptr) const;
 
+  /// Returns the list of broadcast dimensions.
+  /// Ex:
+  ///  * (d0, d1, d2) -> (0, d1) gives [0]
+  ///  * (d0, d1, d2) -> (d2, d1) gives []
+  ///  * (d0, d1, d2, d4) -> (d0, 0, d1, 0) gives [1, 3]
+  SmallVector<unsigned> getBroadcastDims() const;
----------------
banach-space wrote:

Yes - that was my source of inspiration :) It's just below `getBroadcastDims` (though I am about to move it a bit).

Note, `isMinorIdentityWithBroadcasting` wouldn't work as maps in xfer_read/xfer_write can be permutations. I also tried re-using `getBroadcastDims` inside `isMinorIdentityWithBroadcasting`, but that didn't feel right (perhaps `isMinorIdentityWithBroadcasting` should be split?).

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


More information about the Mlir-commits mailing list