Skip to content

Commit bbaa147

Browse files
gitoleglanza
authored andcommitted
[mlir][llvm] Fixes CallOp builder for the case of indirect call
1 parent 5711854 commit bbaa147

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,8 +908,9 @@ void CallOp::build(OpBuilder &builder, OperationState &state, TypeRange results,
908908

909909
void CallOp::build(OpBuilder &builder, OperationState &state, TypeRange results,
910910
FlatSymbolRefAttr callee, ValueRange args) {
911+
auto fargs = callee ? args : args.drop_front();
911912
build(builder, state, results,
912-
TypeAttr::get(getLLVMFuncType(builder.getContext(), results, args)),
913+
TypeAttr::get(getLLVMFuncType(builder.getContext(), results, fargs)),
913914
callee, args, /*fastmathFlags=*/nullptr, /*branch_weights=*/nullptr,
914915
/*CConv=*/nullptr,
915916
/*access_groups=*/nullptr, /*alias_scopes=*/nullptr,

0 commit comments

Comments
 (0)