radeonsi: clean up more HAVE_LLVM #ifdefs
authorMarek Olšák <marek.olsak@amd.com>
Tue, 13 Dec 2016 17:42:08 +0000 (18:42 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 6 Jan 2017 20:05:48 +0000 (21:05 +0100)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeonsi/si_shader.c

index 5e3fcb95c9e70adc4c100f194228145bba199e73..28bb791707ef40ea697a87e60630a93ba7251d58 100644 (file)
 #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)",
index 72cf8270c7800b784ca3d2e6faae33e4538d8b1e..f18aa82987b5122c17b7a2c97d8c7ecc351bc5d1 100644 (file)
@@ -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");