[Mlir-commits] [mlir] [mlir][scf]: Copy old attributes of old ForOp in replaceWithAdditionalYields (PR #95502)
Aviad Cohen
llvmlistbot at llvm.org
Fri Jun 14 01:52:24 PDT 2024
https://github.com/AviadCo updated https://github.com/llvm/llvm-project/pull/95502
>From c1d4c3667aced955f6d36917069ad1734f9ac7d7 Mon Sep 17 00:00:00 2001
From: Aviad Cohen <aviad.cohen2 at mobileye.com>
Date: Fri, 14 Jun 2024 07:15:13 +0300
Subject: [PATCH] [mlir][scf]: Copy old attributes of old ForOp in
replaceWithAdditionalYields
---
mlir/lib/Dialect/SCF/IR/SCF.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/mlir/lib/Dialect/SCF/IR/SCF.cpp b/mlir/lib/Dialect/SCF/IR/SCF.cpp
index 524711dbbb6fd..907d7f794593d 100644
--- a/mlir/lib/Dialect/SCF/IR/SCF.cpp
+++ b/mlir/lib/Dialect/SCF/IR/SCF.cpp
@@ -553,6 +553,7 @@ ForOp::replaceWithAdditionalYields(RewriterBase &rewriter,
scf::ForOp newLoop = rewriter.create<scf::ForOp>(
getLoc(), getLowerBound(), getUpperBound(), getStep(), inits,
[](OpBuilder &, Location, Value, ValueRange) {});
+ newLoop->setAttrs(getPrunedAttributeList(getOperation(), {}));
// Generate the new yield values and append them to the scf.yield operation.
auto yieldOp = cast<scf::YieldOp>(getBody()->getTerminator());
More information about the Mlir-commits
mailing list