[Mlir-commits] [mlir] [mlir][memref] Add ValueBoundsOpInterface external models for the memref operations extract_strided_metadata and assume_alignment (PR #206466)

Hagai Lev Hacohen llvmlistbot at llvm.org
Mon Jun 29 06:14:23 PDT 2026


================
@@ -70,6 +83,37 @@ struct ExpandShapeOpInterface
   }
 };
 
+struct ExtractStridedMetadataOpInterface
+    : public ValueBoundsOpInterface::ExternalModel<
+          ExtractStridedMetadataOpInterface, memref::ExtractStridedMetadataOp> {
+  void populateBoundsForIndexValue(Operation *op, Value value,
+                                   ValueBoundsConstraintSet &cstr) const {
+    auto metadataOp = cast<memref::ExtractStridedMetadataOp>(op);
+
+    if (value == metadataOp.getOffset()) {
+      cstr.bound(value) == metadataOp.getConstifiedMixedOffset();
+      return;
+    }
+
+    for (auto [idx, size] : llvm::enumerate(metadataOp.getSizes())) {
+      if (value != size)
----------------
HagaiLevHacohen wrote:

Thanks for the review, I fixed it

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


More information about the Mlir-commits mailing list