[Mlir-commits] [mlir] [mlir] Add Memref Normalization support for reinterpret_cast op (PR #133417)

Uday Bondhugula llvmlistbot at llvm.org
Fri Apr 4 07:59:09 PDT 2025


================
@@ -1216,53 +1138,57 @@ LogicalResult mlir::affine::replaceAllMemRefUsesWith(
   if (usePositions.empty())
     return success();
 
-  if (usePositions.size() > 1) {
-    // TODO: extend it for this case when needed (rare).
-    assert(false && "multiple dereferencing uses in a single op not supported");
-    return failure();
-  }
-
   unsigned memRefOperandPos = usePositions.front();
 
   OpBuilder builder(op);
   // The following checks if op is dereferencing memref and performs the access
   // index rewrites.
   auto affMapAccInterface = dyn_cast<AffineMapAccessInterface>(op);
----------------
bondhugula wrote:

If `affMap...` isn't used here any more, we shouldn't be dyn_casting it here. Move to its first use site.

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


More information about the Mlir-commits mailing list