Skip to content

Commit a15618f

Browse files
authored
[mlir] feat: add mlirFuncSetResultAttr (#125972)
cc @ftynse @wsmoses
1 parent 14716f2 commit a15618f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

mlir/include/mlir-c/Dialect/Func.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ MLIR_CAPI_EXPORTED void mlirFuncSetArgAttr(MlirOperation op, intptr_t pos,
3535
MlirStringRef name,
3636
MlirAttribute attr);
3737

38+
MLIR_CAPI_EXPORTED void mlirFuncSetResultAttr(MlirOperation op, intptr_t pos,
39+
MlirStringRef name,
40+
MlirAttribute attr);
41+
3842
#ifdef __cplusplus
3943
}
4044
#endif

mlir/lib/CAPI/Dialect/Func.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@ void mlirFuncSetArgAttr(MlirOperation op, intptr_t pos, MlirStringRef name,
1919
llvm::cast<mlir::func::FuncOp>(unwrap(op))
2020
.setArgAttr(pos, unwrap(name), unwrap(attr));
2121
}
22+
23+
void mlirFuncSetResultAttr(MlirOperation op, intptr_t pos, MlirStringRef name,
24+
MlirAttribute attr) {
25+
llvm::cast<mlir::func::FuncOp>(unwrap(op))
26+
.setResultAttr(pos, unwrap(name), unwrap(attr));
27+
}

0 commit comments

Comments
 (0)