From ceaf0202ee153ac851e37e137be24508df56b17c Mon Sep 17 00:00:00 2001 From: Martin Erhart Date: Mon, 6 Oct 2025 11:24:54 +0100 Subject: [PATCH] [RTG] Implement getAsmResultNames for FixedRegisterOp --- include/circt/Dialect/RTG/IR/RTGOps.td | 2 ++ lib/Dialect/RTG/IR/RTGOps.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/circt/Dialect/RTG/IR/RTGOps.td b/include/circt/Dialect/RTG/IR/RTGOps.td index 20747f404a19..a164d1be7c50 100644 --- a/include/circt/Dialect/RTG/IR/RTGOps.td +++ b/include/circt/Dialect/RTG/IR/RTGOps.td @@ -16,6 +16,7 @@ include "mlir/IR/CommonTypeConstraints.td" include "mlir/IR/CommonAttrConstraints.td" include "mlir/IR/Properties.td" include "mlir/IR/SymbolInterfaces.td" +include "mlir/IR/OpAsmInterface.td" include "mlir/Interfaces/InferTypeOpInterface.td" include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/Interfaces/InferTypeOpInterface.td" @@ -657,6 +658,7 @@ def CommentOp : RTGOp<"comment", []> { def FixedRegisterOp : RTGOp<"fixed_reg", [ Pure, ConstantLike, DeclareOpInterfaceMethods, + DeclareOpInterfaceMethods, ]> { let summary = "returns a value representing a fixed register"; let description = [{ diff --git a/lib/Dialect/RTG/IR/RTGOps.cpp b/lib/Dialect/RTG/IR/RTGOps.cpp index 9ba06fef77d2..6973b683ca75 100644 --- a/lib/Dialect/RTG/IR/RTGOps.cpp +++ b/lib/Dialect/RTG/IR/RTGOps.cpp @@ -432,6 +432,10 @@ LogicalResult FixedRegisterOp::inferReturnTypes( OpFoldResult FixedRegisterOp::fold(FoldAdaptor adaptor) { return getRegAttr(); } +void FixedRegisterOp::getAsmResultNames(OpAsmSetValueNameFn setNameFn) { + setNameFn(getResult(), getReg().getRegisterAssembly()); +} + //===----------------------------------------------------------------------===// // VirtualRegisterOp //===----------------------------------------------------------------------===//