Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Carrying local revert:

-
llvm/llvm-project@9c48a04

---------

Signed-off-by: hanhanW <hanhan0912@gmail.com>
  • Loading branch information
hanhanW authored Sep 26, 2024
1 parent d18064f commit 97896ce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 14 additions & 8 deletions compiler/src/iree/compiler/Codegen/LLVMCPU/DispatchABI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1120,15 +1120,18 @@ Value HALDispatchABI::callImport(Operation *forOp, StringRef importName,

Value nullPtrValue = builder.create<LLVM::ZeroOp>(
loc, LLVM::LLVMPointerType::get(builder.getContext()));
SmallVector<Value> args = {
/*thunk_func_ptr=*/thunkPtrValue,
/*import_func_ptr=*/importFunc.first,
/*params=*/params,
/*context=*/importFunc.second,
/*reserved=*/nullPtrValue,
};
auto callOp =
builder.create<LLVM::CallOp>(loc, TypeRange{builder.getI32Type()},
ValueRange{
/*thunk_func_ptr=*/thunkPtrValue,
/*import_func_ptr=*/importFunc.first,
/*params=*/params,
/*context=*/importFunc.second,
/*reserved=*/nullPtrValue,
});
builder.create<LLVM::CallOp>(loc, TypeRange{builder.getI32Type()}, args);
callOp.getProperties().operandSegmentSizes = {
static_cast<int32_t>(args.size()), 0};
callOp.getProperties().op_bundle_sizes = builder.getDenseI32ArrayAttr({});
return callOp.getResult();
}

Expand Down Expand Up @@ -1296,6 +1299,9 @@ FailureOr<SmallVector<Value>> HALDispatchABI::materializeABI(
if (cConv == IREE::HAL::CallingConvention::Default) {
auto callOp = rewriter.create<LLVM::CallOp>(
loc, abiFunctionType->getReturnTypes(), allArgsList, forOp->getAttrs());
callOp.getProperties().operandSegmentSizes = {
static_cast<int32_t>(allArgsList.size()), 0};
callOp.getProperties().op_bundle_sizes = rewriter.getDenseI32ArrayAttr({});
return llvm::map_to_vector(callOp.getResults(),
[](OpResult v) -> Value { return v; });
}
Expand Down
2 changes: 1 addition & 1 deletion third_party/llvm-project
Submodule llvm-project updated 477 files

0 comments on commit 97896ce

Please sign in to comment.