[Mlir-commits] [mlir] [mlir][linalg] Bugfix for `InlineScalarOperands` (PR #111534)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Oct 12 18:56:29 PDT 2024


================
@@ -78,9 +78,11 @@ struct InlineScalarOperands : public OpRewritePattern<GenericOp> {
       for (auto idx : indices)
         indicesValues.emplace_back(
             rewriter.create<arith::ConstantIndexOp>(loc, idx));
-      Value extractedValue = rewriter.create<tensor::ExtractOp>(
-          loc, opOperand->get(), indicesValues);
-      body->getArgument(idx).replaceAllUsesWith(extractedValue);
+      Value scalarValue = opOperand->get();
+      if (isa<RankedTensorType>(scalarValue.getType()))
----------------
MaheshRavishankar wrote:

Nit: add `{` `}` around multi-line statements.

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


More information about the Mlir-commits mailing list