MLIR专题6:函数调用 我们看下toy实例中的函数调用定义:def GenericCallOp : Toy_Op"generic_call" { let summary = "generic call operation"; let description = [{ Generic calls represent calls to a user defined function that needs to be specialized for the shape of its arguments. The callee name is attached as a symbol reference via an attribute. The arguments list must match the arguments expected by the callee. For example: ```mlir %4 = toy.generic_call @my_func(%1, %3) : (tensor2x3xf64, tensor2x3xf64) - tensor*xf64 ``` This is only valid if a function named "my_func" exists and takes two arguments. }]; // The generic call operation takes a symbol reference attribute as the // callee, and inputs for the call. let arguments = (ins FlatSymbolRefAttr:$callee, VariadicF64Tensor:$inputs); // The generic call operation returns a single value of TensorType. let results = (outs F64Tensor); // Specialize assembly printing and parsing using a declarative format. let assemblyFormat = [{ $callee `(` $inputs `)` attr-dict `:` functional-type($inputs, results) }]; // Add custom build methods for the generic call operation. let builders = [ OpBuilder(ins "StringRef":$callee, "ArrayRefValue":$arguments) ]; }这是 Toy 方言中的 函数调用操作 ,与 FuncOp (函数定义)配对使用。1. 操作声明def GenericCallOp : Toy_Op"gene