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

Ivan R. Ivanov llvmlistbot at llvm.org
Fri Dec 22 13:46:33 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();
----------------
ivanradanov wrote:

I wonder if it may be better to have an assert that the `callee` is present here, and instead provide a separate builder, which does not take a `callee` argument at all and have that construct an indirect call.

This should be less confusing as the above builders that take a `callee` arg _always_ result in a direct call.

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


More information about the Mlir-commits mailing list