[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
This commit is contained in:
Mehdi Amini authored and GitHub committed 2026-09-25 09:48:33 +00:00
1 parent f4620e36f5
commit 75811754a2
1 file changed
+2 -1
@@ -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(