I don’t know how overloadedResults and overloadedOperands should be set.To be honest, despite the comments here, I still don’t understand the meaning of this code.Why do Operands and Results need to be overloaded? I don’t understand it.If anyone can help me, I would be grateful.Thanks!
class LLVM_IntrOpBase<Dialect dialect, string opName, string enumName,
list<int> overloadedResults, list<int> overloadedOperands,
list<Trait> traits, int numResults,
bit requiresAccessGroup = 0, bit requiresAliasScope = 0,
bit requiresFastmath = 0>
: LLVM_OpBase<dialect, opName, !listconcat(
!if(!gt(requiresFastmath, 0),
[DeclareOpInterfaceMethods<FastmathFlagsInterface>],
[]),
traits)>,
Results<!if(!gt(numResults, 0), (outs LLVM_Type:$res), (outs))> {
string resultPattern = !if(!gt(numResults, 1),
LLVM_IntrPatterns.structResult,
LLVM_IntrPatterns.result);
string llvmEnumName = enumName;
let llvmBuilder = [{
llvm::Module *module = builder.GetInsertBlock()->getModule();
llvm::Function *fn = llvm::Intrinsic::getDeclaration(
module,
llvm::Intrinsic::}] # enumName # [{,
{ }] # !interleave(!listconcat(
ListIntSubst<resultPattern, overloadedResults>.lst,
ListIntSubst<LLVM_IntrPatterns.operand,
overloadedOperands>.lst), ", ") # [{
});