I’m looking to write an llvmBuilder set to a createIntrinsicCall for an intrinsic which takes 6 args. I can’t find an example like this that already exists in the code base.
So for example:
class ROCDL_XXX<string mnemonic, list traits = []> :
ROCDL_Op<mnemonic, !listconcat(traits, [NoSideEffect])>,
Results<(outs LLVM_Type:$res)>, Arguments<(ins LLVM_Type:$src1,
LLVM_Type:$src2,
LLVM_Type:$src3,
LLVM_Type:$src4,
LLVM_Type:$src5,
LLVM_Type:$src6)> {
string llvmBuilder = “$res = createIntrinsicCall(builder,”
# “llvm::Intrinsic::amdgcn_XXX_” # !subst(".","_", mnemonic) # “,
{$src1, $src2, $src3, $src4, $src5, $src6});”;
let parser = [{ return parseROCDLOp(parser, result); }];
let printer = [{ printROCDLOp(p, this->getOperation()); }];
}
This doesn’t compile nor would it work. Is it not possible to generate the intrinsic from type directly in tablegen in MLIR? Do I have to have an accompanying cpp function call, like getShflBflyIntrinsicId where I pass each argument and have to check each argument and return the intId for each possible argument? This seems rather ugly.