Skip to content

Commit baee0a6

Browse files
add builder for call intrinsic op.
1 parent c9684e5 commit baee0a6

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,6 +2432,7 @@ def LLVM_CallIntrinsicOp
24322432
OpBuilder<(ins "StringAttr":$intrin, "ValueRange":$args)>,
24332433
OpBuilder<(ins "StringAttr":$intrin, "ValueRange":$args, "FastmathFlagsAttr":$fastMathFlags)>,
24342434
OpBuilder<(ins "Type": $resultType, "StringAttr":$intrin, "ValueRange":$args)>,
2435+
OpBuilder<(ins "TypeRange": $resultTypes, "StringAttr":$intrin, "ValueRange":$args)>,
24352436
OpBuilder<(ins "TypeRange": $resultTypes, "StringAttr":$intrin, "ValueRange":$args, "FastmathFlagsAttr":$fastMathFlags)>
24362437
];
24372438

mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3790,6 +3790,14 @@ void CallIntrinsicOp::build(OpBuilder &builder, OperationState &state,
37903790
/*res_attrs=*/{});
37913791
}
37923792

3793+
void CallIntrinsicOp::build(OpBuilder &builder, OperationState &state,
3794+
mlir::TypeRange resultTypes,
3795+
mlir::StringAttr intrin, mlir::ValueRange args) {
3796+
build(builder, state, resultTypes, intrin, args, FastmathFlagsAttr{},
3797+
/*op_bundle_operands=*/{}, /*op_bundle_tags=*/{}, /*arg_attrs=*/{},
3798+
/*res_attrs=*/{});
3799+
}
3800+
37933801
void CallIntrinsicOp::build(OpBuilder &builder, OperationState &state,
37943802
mlir::TypeRange resultTypes,
37953803
mlir::StringAttr intrin, mlir::ValueRange args,

mlir/lib/Target/LLVMIR/LLVMImportInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ LogicalResult mlir::LLVMImportInterface::convertUnregisteredIntrinsic(
4343
builder, moduleImport.translateLoc(inst->getDebugLoc()),
4444
isa<LLVMVoidType>(resultType) ? TypeRange{} : TypeRange{resultType},
4545
StringAttr::get(builder.getContext(), intrinName),
46-
ValueRange{mlirOperands}, FastmathFlagsAttr{});
46+
ValueRange{mlirOperands});
4747

4848
moduleImport.setFastmathFlagsAttr(inst, op);
4949
moduleImport.convertArgAndResultAttrs(inst, op);

0 commit comments

Comments
 (0)