[Mlir-commits] [mlir] 7581175 - [mlir][Tensor] Stop using `getAttrs()` and only copy discardable call attributes explicitly (#226412)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Sep 25 02:48:41 PDT 2026
Author: Mehdi Amini
Date: 2026-09-25T09:48:33Z
New Revision: 75811754a2e6c846543354358317ee02c32c2ce4
URL: https://github.com/llvm/llvm-project/commit/75811754a2e6c846543354358317ee02c32c2ce4
DIFF: https://github.com/llvm/llvm-project/commit/75811754a2e6c846543354358317ee02c32c2ce4.diff
LOG: [mlir][Tensor] Stop using `getAttrs()` and only copy discardable call attributes explicitly (#226412)
Preserve discardable metadata when recreating a typed direct call; its
builder supplies the inherent fields.
Part of #155475
Assisted-by: Codex
Added:
Modified:
mlir/lib/Dialect/Tensor/Transforms/ScalarizeFunctionResult.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Tensor/Transforms/ScalarizeFunctionResult.cpp b/mlir/lib/Dialect/Tensor/Transforms/ScalarizeFunctionResult.cpp
index 60385d0c8b50d1..c0c92db18db80c 100644
--- a/mlir/lib/Dialect/Tensor/Transforms/ScalarizeFunctionResult.cpp
+++ b/mlir/lib/Dialect/Tensor/Transforms/ScalarizeFunctionResult.cpp
@@ -228,7 +228,8 @@ static void rewriteScalarizableFunction(func::FuncOp func,
rewriter.setInsertionPoint(directCall);
func::CallOp newDirectCall = func::CallOp::create(
rewriter, directCall.getLoc(), func, directCall.getOperands());
- newDirectCall->setAttrs(directCall->getAttrs());
+ newDirectCall->setDiscardableAttrs(
+ directCall->getDiscardableAttrDictionary());
if (!directCall.getResult(0).use_empty()) {
Value wrappedResult = tensor::FromElementsOp::create(
More information about the Mlir-commits
mailing list