mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
radv: setup llvm target data layout
Ported from radeonsi, pointed out by Tom. "This prevents LLVM from using sext instructions for local memory offsets and allows the backend to fold immediate offsets into the instruction. This also prevents some incorrect code generation for ptrtoint and inttoptr instructions." Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Tom Stellard <tstellar@redhat.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
c19607d59d
commit
b8ee70384a
1 changed files with 7 additions and 0 deletions
|
|
@ -4793,6 +4793,13 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
|
|||
memset(shader_info, 0, sizeof(*shader_info));
|
||||
|
||||
LLVMSetTarget(ctx.module, options->supports_spill ? "amdgcn-mesa-mesa3d" : "amdgcn--");
|
||||
|
||||
LLVMTargetDataRef data_layout = LLVMCreateTargetDataLayout(tm);
|
||||
char *data_layout_str = LLVMCopyStringRepOfTargetData(data_layout);
|
||||
LLVMSetDataLayout(ctx.module, data_layout_str);
|
||||
LLVMDisposeTargetData(data_layout);
|
||||
LLVMDisposeMessage(data_layout_str);
|
||||
|
||||
setup_types(&ctx);
|
||||
|
||||
ctx.builder = LLVMCreateBuilderInContext(ctx.context);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue