[mlir][llvmir] Added extra builders for CallInstrinsicOp (#111664)
Extra builders for CallIntrinsicOp. This is inspired by the comment from @antiagainst from [here](https://github.com/llvm/llvm-project/pull/108933#issuecomment-2392751569).
This commit is contained in:
@@ -1947,6 +1947,13 @@ def LLVM_CallIntrinsicOp
|
||||
attr-dict
|
||||
}];
|
||||
|
||||
let builders = [
|
||||
OpBuilder<(ins "StringAttr":$intrin, "ValueRange":$args)>,
|
||||
OpBuilder<(ins "StringAttr":$intrin, "ValueRange":$args, "FastmathFlagsAttr":$fastMathFlags)>,
|
||||
OpBuilder<(ins "Type": $resultType, "StringAttr":$intrin, "ValueRange":$args)>,
|
||||
OpBuilder<(ins "TypeRange": $resultTypes, "StringAttr":$intrin, "ValueRange":$args, "FastmathFlagsAttr":$fastMathFlags)>
|
||||
];
|
||||
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -3328,6 +3328,36 @@ LogicalResult CallIntrinsicOp::verify() {
|
||||
return success();
|
||||
}
|
||||
|
||||
void CallIntrinsicOp::build(OpBuilder &builder, OperationState &state,
|
||||
mlir::StringAttr intrin, mlir::ValueRange args) {
|
||||
build(builder, state, /*resultTypes=*/TypeRange{}, intrin, args,
|
||||
FastmathFlagsAttr{},
|
||||
/*op_bundle_operands=*/{});
|
||||
}
|
||||
|
||||
void CallIntrinsicOp::build(OpBuilder &builder, OperationState &state,
|
||||
mlir::StringAttr intrin, mlir::ValueRange args,
|
||||
mlir::LLVM::FastmathFlagsAttr fastMathFlags) {
|
||||
build(builder, state, /*resultTypes=*/TypeRange{}, intrin, args,
|
||||
fastMathFlags,
|
||||
/*op_bundle_operands=*/{});
|
||||
}
|
||||
|
||||
void CallIntrinsicOp::build(OpBuilder &builder, OperationState &state,
|
||||
mlir::Type resultType, mlir::StringAttr intrin,
|
||||
mlir::ValueRange args) {
|
||||
build(builder, state, {resultType}, intrin, args, FastmathFlagsAttr{},
|
||||
/*op_bundle_operands=*/{});
|
||||
}
|
||||
|
||||
void CallIntrinsicOp::build(OpBuilder &builder, OperationState &state,
|
||||
mlir::TypeRange resultTypes,
|
||||
mlir::StringAttr intrin, mlir::ValueRange args,
|
||||
mlir::LLVM::FastmathFlagsAttr fastMathFlags) {
|
||||
build(builder, state, resultTypes, intrin, args, fastMathFlags,
|
||||
/*op_bundle_operands=*/{});
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// OpAsmDialectInterface
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
Reference in New Issue
Block a user