From: Marek Olšák Date: Tue, 13 Dec 2016 17:42:08 +0000 (+0100) Subject: radeonsi: clean up more HAVE_LLVM #ifdefs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=42920c0fb98eee586000eee3b122c57d8374e42f;p=mesa.git radeonsi: clean up more HAVE_LLVM #ifdefs Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 5e3fcb95c9e..28bb791707e 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -43,6 +43,10 @@ #define HAVE_LLVM 0 #endif +#ifndef MESA_LLVM_VERSION_PATCH +#define MESA_LLVM_VERSION_PATCH 0 +#endif + struct r600_multi_fence { struct pipe_reference reference; struct pipe_fence_handle *gfx; @@ -1213,11 +1217,11 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen, snprintf(kernel_version, sizeof(kernel_version), " / %s", uname_data.release); -#if HAVE_LLVM - snprintf(llvm_string, sizeof(llvm_string), - ", LLVM %i.%i.%i", (HAVE_LLVM >> 8) & 0xff, - HAVE_LLVM & 0xff, MESA_LLVM_VERSION_PATCH); -#endif + if (HAVE_LLVM > 0) { + snprintf(llvm_string, sizeof(llvm_string), + ", LLVM %i.%i.%i", (HAVE_LLVM >> 8) & 0xff, + HAVE_LLVM & 0xff, MESA_LLVM_VERSION_PATCH); + } snprintf(rscreen->renderer_string, sizeof(rscreen->renderer_string), "%s (DRM %i.%i.%i%s%s)", diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 72cf8270c78..f18aa82987b 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -1771,16 +1771,19 @@ static void declare_system_value( value = LLVMGetParam(radeon_bld->main_fn, SI_PARAM_THREAD_ID); break; -#if HAVE_LLVM >= 0x0309 case TGSI_SEMANTIC_HELPER_INVOCATION: - value = lp_build_intrinsic(gallivm->builder, - "llvm.amdgcn.ps.live", - ctx->i1, NULL, 0, - LP_FUNC_ATTR_READNONE); - value = LLVMBuildNot(gallivm->builder, value, ""); - value = LLVMBuildSExt(gallivm->builder, value, ctx->i32, ""); + if (HAVE_LLVM >= 0x0309) { + value = lp_build_intrinsic(gallivm->builder, + "llvm.amdgcn.ps.live", + ctx->i1, NULL, 0, + LP_FUNC_ATTR_READNONE); + value = LLVMBuildNot(gallivm->builder, value, ""); + value = LLVMBuildSExt(gallivm->builder, value, ctx->i32, ""); + } else { + assert(!"TGSI_SEMANTIC_HELPER_INVOCATION unsupported"); + return; + } break; -#endif default: assert(!"unknown system value");