diff options
author | Marek Olšák <[email protected]> | 2019-06-19 19:00:50 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-06-24 21:04:10 -0400 |
commit | ac4b1e2f0aa987b075be0bac3b4a9e69b5ec4d07 (patch) | |
tree | 400ddbac9146a155a86545ffae9dcc1bd91e431f /src/amd/common | |
parent | 610e1a81f768aced998bdedf8037a5f4a4e446ca (diff) |
radeonsi: set the calling convention for inlined function calls
otherwise the behavior is undefined
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 8 | ||||
-rw-r--r-- | src/amd/common/ac_llvm_build.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index edadd56cc7b..92c878acdcf 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -4445,3 +4445,11 @@ ac_build_load_helper_invocation(struct ac_llvm_context *ctx) result = LLVMBuildNot(ctx->builder, result, ""); return LLVMBuildSExt(ctx->builder, result, ctx->i32, ""); } + +LLVMValueRef ac_build_call(struct ac_llvm_context *ctx, LLVMValueRef func, + LLVMValueRef *args, unsigned num_args) +{ + LLVMValueRef ret = LLVMBuildCall(ctx->builder, func, args, num_args, ""); + LLVMSetInstructionCallConv(ret, LLVMGetFunctionCallConv(func)); + return ret; +} diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h index a1654d2b2c4..1928843c78c 100644 --- a/src/amd/common/ac_llvm_build.h +++ b/src/amd/common/ac_llvm_build.h @@ -720,6 +720,9 @@ ac_build_ddxy_interp(struct ac_llvm_context *ctx, LLVMValueRef interp_ij); LLVMValueRef ac_build_load_helper_invocation(struct ac_llvm_context *ctx); +LLVMValueRef ac_build_call(struct ac_llvm_context *ctx, LLVMValueRef func, + LLVMValueRef *args, unsigned num_args); + LLVMValueRef ac_build_atomic_rmw(struct ac_llvm_context *ctx, LLVMAtomicRMWBinOp op, LLVMValueRef ptr, LLVMValueRef val, const char *sync_scope); |