[Mlir-commits] [mlir] [mlir][llvm] Fixes CallOp builder for the case of indirect call (PR #76240)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Dec 25 07:12:58 PST 2023


================
@@ -908,8 +908,9 @@ void CallOp::build(OpBuilder &builder, OperationState &state, TypeRange results,
 
 void CallOp::build(OpBuilder &builder, OperationState &state, TypeRange results,
                    FlatSymbolRefAttr callee, ValueRange args) {
+  auto fargs = callee ? args : args.drop_front();
----------------
gitoleg wrote:

So, I added an assert in the builder.   And I think we can use [this](https://github.com/llvm/llvm-project/blob/d8ddcae547e782a4765783c62747381624f076d4/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td#L637l) builder to construct indirect calls

>  Is there actually a reason to set the callee type in the builder that the revision modifies. After all, the builder does not work for variadic functions. So just setting the calle_type to nullptr may also be an option?

Well, in this case we'll break the `getCalleeFunctionType` function, as far as I see

@ivanradanov @gysit 

https://github.com/llvm/llvm-project/pull/76240


More information about the Mlir-commits mailing list