[Mlir-commits] [mlir] [mlir][affine]fix create affine.for bug. (PR #117721)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Wed Nov 27 04:51:34 PST 2024


================
@@ -352,9 +353,13 @@ static bool isDimOpValidSymbol(ShapedDimOpInterface dimOp, Region *region) {
 
   // Conservatively handle remaining BlockArguments as non-valid symbols.
   // E.g. scf.for iterArgs.
-  if (llvm::isa<BlockArgument>(dimOp.getShapedValue()))
-    return false;
-
+  if (auto blockArgument =
+          llvm::dyn_cast<BlockArgument>(dimOp.getShapedValue())) {
+    if (!llvm::isa<FunctionOpInterface>(
+            blockArgument.getParentRegion()->getParentOp())) {
----------------
ftynse wrote:

Functions may have blocks other than the entry block. Not all block arguments are function arguments, so this change looks suspicious to me.

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


More information about the Mlir-commits mailing list