[Mlir-commits] [mlir] d7e4813 - [mlir][scf]: Copy old attributes of old ForOp in replaceWithAdditionalYields (#95502)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jun 14 20:09:38 PDT 2024


Author: Aviad Cohen
Date: 2024-06-15T06:09:33+03:00
New Revision: d7e4813a324f2e33726dec8c9a599cb342f0bde3

URL: https://github.com/llvm/llvm-project/commit/d7e4813a324f2e33726dec8c9a599cb342f0bde3
DIFF: https://github.com/llvm/llvm-project/commit/d7e4813a324f2e33726dec8c9a599cb342f0bde3.diff

LOG: [mlir][scf]: Copy old attributes of old ForOp in replaceWithAdditionalYields (#95502)

Added: 
    

Modified: 
    mlir/lib/Dialect/SCF/IR/SCF.cpp

Removed: 
    


################################################################################
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