mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
amd: drop support for LLVM 9
This would be easy to support except that it doesn't support RDNA 2. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10199>
This commit is contained in:
parent
936b58378c
commit
2747332723
6 changed files with 4 additions and 33 deletions
|
|
@ -1536,10 +1536,8 @@ if with_tests or with_gallium_softpipe
|
|||
llvm_modules += 'native'
|
||||
endif
|
||||
|
||||
if with_microsoft_clc
|
||||
if with_microsoft_clc or with_amd_vk or with_gallium_radeonsi
|
||||
_llvm_version = '>= 10.0.0'
|
||||
elif with_amd_vk or with_gallium_radeonsi
|
||||
_llvm_version = '>= 9.0.0'
|
||||
elif with_gallium_opencl
|
||||
_llvm_version = '>= 8.0.0'
|
||||
elif with_gallium_swr
|
||||
|
|
|
|||
|
|
@ -51,14 +51,8 @@ void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes)
|
|||
|
||||
void ac_add_attr_alignment(LLVMValueRef val, uint64_t bytes)
|
||||
{
|
||||
#if LLVM_VERSION_MAJOR >= 10
|
||||
llvm::Argument *A = llvm::unwrap<llvm::Argument>(val);
|
||||
A->addAttr(llvm::Attribute::getWithAlignment(A->getContext(), llvm::Align(bytes)));
|
||||
#else
|
||||
/* Avoid unused parameter warnings. */
|
||||
(void)val;
|
||||
(void)bytes;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ac_is_sgpr_param(LLVMValueRef arg)
|
||||
|
|
@ -235,11 +229,7 @@ struct ac_compiler_passes *ac_create_llvm_passes(LLVMTargetMachineRef tm)
|
|||
llvm::TargetMachine *TM = reinterpret_cast<llvm::TargetMachine *>(tm);
|
||||
|
||||
if (TM->addPassesToEmitFile(p->passmgr, p->ostream, nullptr,
|
||||
#if LLVM_VERSION_MAJOR >= 10
|
||||
llvm::CGFT_ObjectFile)) {
|
||||
#else
|
||||
llvm::TargetMachine::CGFT_ObjectFile)) {
|
||||
#endif
|
||||
fprintf(stderr, "amd: TargetMachine can't emit a file of this type!\n");
|
||||
delete p;
|
||||
return NULL;
|
||||
|
|
@ -309,11 +299,9 @@ LLVMValueRef ac_build_atomic_rmw(struct ac_llvm_context *ctx, LLVMAtomicRMWBinOp
|
|||
case LLVMAtomicRMWBinOpUMin:
|
||||
binop = llvm::AtomicRMWInst::UMin;
|
||||
break;
|
||||
#if LLVM_VERSION_MAJOR >= 10
|
||||
case LLVMAtomicRMWBinOpFAdd:
|
||||
binop = llvm::AtomicRMWInst::FAdd;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
unreachable("invalid LLVMAtomicRMWBinOp");
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -67,10 +67,8 @@ static void ac_init_llvm_target(void)
|
|||
"mesa",
|
||||
"-simplifycfg-sink-common=false",
|
||||
"-global-isel-abort=2",
|
||||
#if LLVM_VERSION_MAJOR >= 10
|
||||
/* Atomic optimizations require LLVM 10.0 for gfx10 support. */
|
||||
"-amdgpu-atomic-optimizations=true",
|
||||
#endif
|
||||
#if LLVM_VERSION_MAJOR >= 11
|
||||
/* This was disabled by default in: https://reviews.llvm.org/D77228 */
|
||||
"-structurizecfg-skip-uniform-regions",
|
||||
|
|
|
|||
|
|
@ -3013,11 +3013,9 @@ static LLVMValueRef visit_var_atomic(struct ac_nir_context *ctx, const nir_intri
|
|||
case nir_intrinsic_shared_atomic_exchange:
|
||||
op = LLVMAtomicRMWBinOpXchg;
|
||||
break;
|
||||
#if LLVM_VERSION_MAJOR >= 10
|
||||
case nir_intrinsic_shared_atomic_fadd:
|
||||
op = LLVMAtomicRMWBinOpFAdd;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -5038,17 +5036,8 @@ static void setup_constant_data(struct ac_nir_context *ctx, struct nir_shader *s
|
|||
LLVMValueRef data = LLVMConstStringInContext(ctx->ac.context, shader->constant_data,
|
||||
shader->constant_data_size, true);
|
||||
LLVMTypeRef type = LLVMArrayType(ctx->ac.i8, shader->constant_data_size);
|
||||
|
||||
/* We want to put the constant data in the CONST address space so that
|
||||
* we can use scalar loads. However, LLVM versions before 10 put these
|
||||
* variables in the same section as the code, which is unacceptable
|
||||
* for RadeonSI as it needs to relocate all the data sections after
|
||||
* the code sections. See https://reviews.llvm.org/D65813.
|
||||
*/
|
||||
unsigned address_space = LLVM_VERSION_MAJOR < 10 ? AC_ADDR_SPACE_GLOBAL : AC_ADDR_SPACE_CONST;
|
||||
|
||||
LLVMValueRef global =
|
||||
LLVMAddGlobalInAddressSpace(ctx->ac.module, type, "const_data", address_space);
|
||||
LLVMAddGlobalInAddressSpace(ctx->ac.module, type, "const_data", AC_ADDR_SPACE_CONST);
|
||||
|
||||
LLVMSetInitializer(global, data);
|
||||
LLVMSetGlobalConstant(global, true);
|
||||
|
|
|
|||
|
|
@ -1579,8 +1579,7 @@ radv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
|
|||
features->shaderBufferFloat64Atomics = true;
|
||||
features->shaderBufferFloat64AtomicAdd = false;
|
||||
features->shaderSharedFloat32Atomics = true;
|
||||
features->shaderSharedFloat32AtomicAdd = pdevice->rad_info.chip_class >= GFX8 &&
|
||||
(!pdevice->use_llvm || LLVM_VERSION_MAJOR >= 10);
|
||||
features->shaderSharedFloat32AtomicAdd = pdevice->rad_info.chip_class >= GFX8;
|
||||
features->shaderSharedFloat64Atomics = true;
|
||||
features->shaderSharedFloat64AtomicAdd = false;
|
||||
features->shaderImageFloat32Atomics = true;
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION:
|
||||
case PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0:
|
||||
case PIPE_CAP_COMPUTE_SHADER_DERIVATIVES:
|
||||
case PIPE_CAP_TGSI_ATOMINC_WRAP:
|
||||
return 1;
|
||||
|
||||
case PIPE_CAP_GLSL_ZERO_INIT:
|
||||
|
|
@ -337,8 +338,6 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
return sscreen->info.pci_dev;
|
||||
case PIPE_CAP_PCI_FUNCTION:
|
||||
return sscreen->info.pci_func;
|
||||
case PIPE_CAP_TGSI_ATOMINC_WRAP:
|
||||
return LLVM_VERSION_MAJOR >= 10;
|
||||
|
||||
default:
|
||||
return u_pipe_screen_get_param_defaults(pscreen, param);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue