Mesa (master): radv: remove RADV_DEBUG=nothreadllvm

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 23 11:39:05 UTC 2021


Module: Mesa
Branch: master
Commit: bba6be03f9c2f1e0b558159a4601e950b8d9cbe9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bba6be03f9c2f1e0b558159a4601e950b8d9cbe9

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Fri Apr 23 12:16:40 2021 +0200

radv: remove RADV_DEBUG=nothreadllvm

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10429>

---

 docs/envvars.rst                    |  2 --
 src/amd/vulkan/radv_debug.h         | 29 +++++++++++++--------------
 src/amd/vulkan/radv_device.c        |  1 -
 src/amd/vulkan/radv_llvm_helper.cpp | 40 ++++++++++++-------------------------
 src/amd/vulkan/radv_nir_to_llvm.c   |  7 +------
 src/amd/vulkan/radv_shader_helper.h |  6 ++----
 6 files changed, 30 insertions(+), 55 deletions(-)

diff --git a/docs/envvars.rst b/docs/envvars.rst
index 5cebbb37754..4b8fb275d84 100644
--- a/docs/envvars.rst
+++ b/docs/envvars.rst
@@ -597,8 +597,6 @@ RADV driver environment variables
       disable out-of-order rasterization
    ``notccompatcmask``
       disable TC-compat CMASK for MSAA surfaces
-   ``nothreadllvm``
-      disable LLVM threaded compilation
    ``noumr``
       disable UMR dumps during GPU hang detection (only with RADV_DEBUG=hang)
    ``novrsflatshading``
diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h
index 922b29af8e8..5d55722b1dd 100644
--- a/src/amd/vulkan/radv_debug.h
+++ b/src/amd/vulkan/radv_debug.h
@@ -48,21 +48,20 @@ enum {
    RADV_DEBUG_ERRORS = 1ull << 17,
    RADV_DEBUG_STARTUP = 1ull << 18,
    RADV_DEBUG_CHECKIR = 1ull << 19,
-   RADV_DEBUG_NOTHREADLLVM = 1ull << 20,
-   RADV_DEBUG_NOBINNING = 1ull << 21,
-   RADV_DEBUG_NO_NGG = 1ull << 22,
-   RADV_DEBUG_DUMP_META_SHADERS = 1ull << 23,
-   RADV_DEBUG_NO_MEMORY_CACHE = 1ull << 24,
-   RADV_DEBUG_DISCARD_TO_DEMOTE = 1ull << 25,
-   RADV_DEBUG_LLVM = 1ull << 26,
-   RADV_DEBUG_FORCE_COMPRESS = 1ull << 27,
-   RADV_DEBUG_HANG = 1ull << 28,
-   RADV_DEBUG_IMG = 1ull << 29,
-   RADV_DEBUG_NO_UMR = 1ull << 30,
-   RADV_DEBUG_INVARIANT_GEOM = 1ull << 31,
-   RADV_DEBUG_NO_DISPLAY_DCC = 1ull << 32,
-   RADV_DEBUG_NO_TC_COMPAT_CMASK = 1ull << 33,
-   RADV_DEBUG_NO_VRS_FLAT_SHADING = 1ull << 34,
+   RADV_DEBUG_NOBINNING = 1ull << 20,
+   RADV_DEBUG_NO_NGG = 1ull << 21,
+   RADV_DEBUG_DUMP_META_SHADERS = 1ull << 22,
+   RADV_DEBUG_NO_MEMORY_CACHE = 1ull << 23,
+   RADV_DEBUG_DISCARD_TO_DEMOTE = 1ull << 24,
+   RADV_DEBUG_LLVM = 1ull << 25,
+   RADV_DEBUG_FORCE_COMPRESS = 1ull << 26,
+   RADV_DEBUG_HANG = 1ull << 27,
+   RADV_DEBUG_IMG = 1ull << 28,
+   RADV_DEBUG_NO_UMR = 1ull << 29,
+   RADV_DEBUG_INVARIANT_GEOM = 1ull << 30,
+   RADV_DEBUG_NO_DISPLAY_DCC = 1ull << 31,
+   RADV_DEBUG_NO_TC_COMPAT_CMASK = 1ull << 32,
+   RADV_DEBUG_NO_VRS_FLAT_SHADING = 1ull << 33,
 };
 
 enum {
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 03cc55aaa51..f45e815cd49 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -772,7 +772,6 @@ static const struct debug_control radv_debug_options[] = {
    {"errors", RADV_DEBUG_ERRORS},
    {"startup", RADV_DEBUG_STARTUP},
    {"checkir", RADV_DEBUG_CHECKIR},
-   {"nothreadllvm", RADV_DEBUG_NOTHREADLLVM},
    {"nobinning", RADV_DEBUG_NOBINNING},
    {"nongg", RADV_DEBUG_NO_NGG},
    {"metashaders", RADV_DEBUG_DUMP_META_SHADERS},
diff --git a/src/amd/vulkan/radv_llvm_helper.cpp b/src/amd/vulkan/radv_llvm_helper.cpp
index c47193e6103..9ad2b5a8fa1 100644
--- a/src/amd/vulkan/radv_llvm_helper.cpp
+++ b/src/amd/vulkan/radv_llvm_helper.cpp
@@ -106,38 +106,24 @@ radv_compile_to_elf(struct ac_llvm_compiler *info, LLVMModuleRef module, char **
 }
 
 bool
-radv_init_llvm_compiler(struct ac_llvm_compiler *info, bool thread_compiler,
-                        enum radeon_family family, enum ac_target_machine_options tm_options,
-                        unsigned wave_size)
+radv_init_llvm_compiler(struct ac_llvm_compiler *info, enum radeon_family family,
+                        enum ac_target_machine_options tm_options, unsigned wave_size)
 {
-   if (thread_compiler) {
-      for (auto &I : radv_llvm_per_thread_list) {
-         if (I.is_same(family, tm_options, wave_size)) {
-            *info = I.llvm_info;
-            return true;
-         }
+   for (auto &I : radv_llvm_per_thread_list) {
+      if (I.is_same(family, tm_options, wave_size)) {
+         *info = I.llvm_info;
+         return true;
       }
+   }
 
-      radv_llvm_per_thread_list.emplace_back(family, tm_options, wave_size);
-      radv_llvm_per_thread_info &tinfo = radv_llvm_per_thread_list.back();
-
-      if (!tinfo.init()) {
-         radv_llvm_per_thread_list.pop_back();
-         return false;
-      }
+   radv_llvm_per_thread_list.emplace_back(family, tm_options, wave_size);
+   radv_llvm_per_thread_info &tinfo = radv_llvm_per_thread_list.back();
 
-      *info = tinfo.llvm_info;
-      return true;
+   if (!tinfo.init()) {
+      radv_llvm_per_thread_list.pop_back();
+      return false;
    }
 
-   if (!ac_init_llvm_compiler(info, family, tm_options))
-      return false;
+   *info = tinfo.llvm_info;
    return true;
 }
-
-void
-radv_destroy_llvm_compiler(struct ac_llvm_compiler *info, bool thread_compiler)
-{
-   if (!thread_compiler)
-      ac_destroy_llvm_compiler(info);
-}
diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c
index 5234a6cd66f..26fba7d9fcd 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -3400,15 +3400,12 @@ llvm_compile_shader(struct radv_device *device, unsigned shader_count,
 {
    enum ac_target_machine_options tm_options = 0;
    struct ac_llvm_compiler ac_llvm;
-   bool thread_compiler;
 
    tm_options |= AC_TM_SUPPORTS_SPILL;
    if (args->options->check_ir)
       tm_options |= AC_TM_CHECK_IR;
 
-   thread_compiler = !(device->instance->debug_flags & RADV_DEBUG_NOTHREADLLVM);
-
-   radv_init_llvm_compiler(&ac_llvm, thread_compiler, args->options->family, tm_options,
+   radv_init_llvm_compiler(&ac_llvm, args->options->family, tm_options,
                            args->shader_info->wave_size);
 
    if (args->is_gs_copy_shader) {
@@ -3416,6 +3413,4 @@ llvm_compile_shader(struct radv_device *device, unsigned shader_count,
    } else {
       radv_compile_nir_shader(&ac_llvm, binary, args, shaders, shader_count);
    }
-
-   radv_destroy_llvm_compiler(&ac_llvm, thread_compiler);
 }
diff --git a/src/amd/vulkan/radv_shader_helper.h b/src/amd/vulkan/radv_shader_helper.h
index 5e01ca40145..e57d72dd9d0 100644
--- a/src/amd/vulkan/radv_shader_helper.h
+++ b/src/amd/vulkan/radv_shader_helper.h
@@ -29,10 +29,8 @@
 extern "C" {
 #endif
 
-bool radv_init_llvm_compiler(struct ac_llvm_compiler *info, bool thread_compiler,
-                             enum radeon_family family, enum ac_target_machine_options tm_options,
-                             unsigned wave_size);
-void radv_destroy_llvm_compiler(struct ac_llvm_compiler *info, bool thread_compiler);
+bool radv_init_llvm_compiler(struct ac_llvm_compiler *info, enum radeon_family family,
+                             enum ac_target_machine_options tm_options, unsigned wave_size);
 
 bool radv_compile_to_elf(struct ac_llvm_compiler *info, LLVMModuleRef module, char **pelf_buffer,
                          size_t *pelf_size);



More information about the mesa-commit mailing list