Skip to content

Commit 81ff229

Browse files
authored
[RTG] Implement getAsmResultNames for FixedRegisterOp (#9058)
1 parent e6674ee commit 81ff229

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

include/circt/Dialect/RTG/IR/RTGOps.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ include "mlir/IR/CommonTypeConstraints.td"
1616
include "mlir/IR/CommonAttrConstraints.td"
1717
include "mlir/IR/Properties.td"
1818
include "mlir/IR/SymbolInterfaces.td"
19+
include "mlir/IR/OpAsmInterface.td"
1920
include "mlir/Interfaces/InferTypeOpInterface.td"
2021
include "mlir/Interfaces/SideEffectInterfaces.td"
2122
include "mlir/Interfaces/InferTypeOpInterface.td"
@@ -657,6 +658,7 @@ def CommentOp : RTGOp<"comment", []> {
657658
def FixedRegisterOp : RTGOp<"fixed_reg", [
658659
Pure, ConstantLike,
659660
DeclareOpInterfaceMethods<InferTypeOpInterface>,
661+
DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
660662
]> {
661663
let summary = "returns a value representing a fixed register";
662664
let description = [{

lib/Dialect/RTG/IR/RTGOps.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,10 @@ LogicalResult FixedRegisterOp::inferReturnTypes(
432432

433433
OpFoldResult FixedRegisterOp::fold(FoldAdaptor adaptor) { return getRegAttr(); }
434434

435+
void FixedRegisterOp::getAsmResultNames(OpAsmSetValueNameFn setNameFn) {
436+
setNameFn(getResult(), getReg().getRegisterAssembly());
437+
}
438+
435439
//===----------------------------------------------------------------------===//
436440
// VirtualRegisterOp
437441
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)