radv: remove the load/store workaround for Monster Hunter World with LLVM
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 26 Jun 2020 07:27:46 +0000 (09:27 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 26 Jun 2020 12:42:44 +0000 (14:42 +0200)
Now that ACO is default, this is pointless.

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

docs/envvars.rst
src/amd/llvm/ac_llvm_util.c
src/amd/llvm/ac_llvm_util.h
src/amd/vulkan/radv_debug.h
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_nir_to_llvm.c

index 4ad5e72..3177347 100644 (file)
@@ -540,8 +540,6 @@ RADV driver environment variables
       disable HIZ for depthstencil images
    ``noibs``
       disable directly recording command buffers in GPU-visible memory
-   ``noloadstoreopt``
-      disable LLVM SILoadStoreOptimizer pass
    ``nomemorycache``
       disable memory shaders cache
    ``nongg``
index 10a931b..62e163b 100644 (file)
@@ -175,14 +175,13 @@ static LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family,
        LLVMTargetRef target = ac_get_llvm_target(triple);
 
        snprintf(features, sizeof(features),
-                "+DumpCode%s%s%s%s%s%s",
+                "+DumpCode%s%s%s%s%s",
                 LLVM_VERSION_MAJOR >= 11 ? "" : ",-fp32-denormals,+fp64-denormals",
                 family >= CHIP_NAVI10 && !(tm_options & AC_TM_WAVE32) ?
                         ",+wavefrontsize64,-wavefrontsize32" : "",
                 family <= CHIP_NAVI14 && tm_options & AC_TM_FORCE_ENABLE_XNACK ? ",+xnack" : "",
                 family <= CHIP_NAVI14 && tm_options & AC_TM_FORCE_DISABLE_XNACK ? ",-xnack" : "",
-                tm_options & AC_TM_PROMOTE_ALLOCA_TO_SCRATCH ? ",-promote-alloca" : "",
-                tm_options & AC_TM_NO_LOAD_STORE_OPT ? ",-load-store-opt" : "");
+                tm_options & AC_TM_PROMOTE_ALLOCA_TO_SCRATCH ? ",-promote-alloca" : "");
 
        LLVMTargetMachineRef tm = LLVMCreateTargetMachine(
                                     target,
index f9650bd..1d90a6a 100644 (file)
@@ -64,8 +64,7 @@ enum ac_target_machine_options {
        AC_TM_CHECK_IR = (1 << 4),
        AC_TM_ENABLE_GLOBAL_ISEL = (1 << 5),
        AC_TM_CREATE_LOW_OPT = (1 << 6),
-       AC_TM_NO_LOAD_STORE_OPT = (1 << 7),
-       AC_TM_WAVE32 = (1 << 8),
+       AC_TM_WAVE32 = (1 << 7),
 };
 
 enum ac_float_mode {
index 557e402..df7d4d2 100644 (file)
@@ -50,13 +50,12 @@ enum {
        RADV_DEBUG_CHECKIR           = 0x80000,
        RADV_DEBUG_NOTHREADLLVM      = 0x100000,
        RADV_DEBUG_NOBINNING         = 0x200000,
-       RADV_DEBUG_NO_LOAD_STORE_OPT = 0x400000,
-       RADV_DEBUG_NO_NGG            = 0x800000,
-       RADV_DEBUG_ALL_ENTRYPOINTS   = 0x1000000,
-       RADV_DEBUG_DUMP_META_SHADERS = 0x2000000,
-       RADV_DEBUG_NO_MEMORY_CACHE   = 0x4000000,
-       RADV_DEBUG_DISCARD_TO_DEMOTE = 0x8000000,
-       RADV_DEBUG_LLVM              = 0x10000000,
+       RADV_DEBUG_NO_NGG            = 0x400000,
+       RADV_DEBUG_ALL_ENTRYPOINTS   = 0x800000,
+       RADV_DEBUG_DUMP_META_SHADERS = 0x1000000,
+       RADV_DEBUG_NO_MEMORY_CACHE   = 0x2000000,
+       RADV_DEBUG_DISCARD_TO_DEMOTE = 0x4000000,
+       RADV_DEBUG_LLVM              = 0x8000000,
 };
 
 enum {
index 84f7707..ef30924 100644 (file)
@@ -501,7 +501,6 @@ static const struct debug_control radv_debug_options[] = {
        {"checkir", RADV_DEBUG_CHECKIR},
        {"nothreadllvm", RADV_DEBUG_NOTHREADLLVM},
        {"nobinning", RADV_DEBUG_NOBINNING},
-       {"noloadstoreopt", RADV_DEBUG_NO_LOAD_STORE_OPT},
        {"nongg", RADV_DEBUG_NO_NGG},
        {"allentrypoints", RADV_DEBUG_ALL_ENTRYPOINTS},
        {"metashaders", RADV_DEBUG_DUMP_META_SHADERS},
@@ -548,13 +547,6 @@ radv_handle_per_app_options(struct radv_instance *instance,
                if (!strcmp(name, "DOOM_VFR")) {
                        /* Work around a Doom VFR game bug */
                        instance->debug_flags |= RADV_DEBUG_NO_DYNAMIC_BOUNDS;
-               } else if (!strcmp(name, "MonsterHunterWorld.exe")) {
-                       /* Workaround for a WaW hazard when LLVM moves/merges
-                        * load/store memory operations.
-                        * See https://reviews.llvm.org/D61313
-                        */
-                       if (LLVM_VERSION_MAJOR < 9)
-                               instance->debug_flags |= RADV_DEBUG_NO_LOAD_STORE_OPT;
                } else if (!strcmp(name, "Fledge")) {
                        /*
                         * Zero VRAM for "The Surge 2"
index 6ad327b..987d105 100644 (file)
@@ -4440,8 +4440,6 @@ llvm_compile_shader(struct radv_device *device,
        tm_options |= AC_TM_SUPPORTS_SPILL;
        if (args->options->check_ir)
                tm_options |= AC_TM_CHECK_IR;
-       if (device->instance->debug_flags & RADV_DEBUG_NO_LOAD_STORE_OPT)
-               tm_options |= AC_TM_NO_LOAD_STORE_OPT;
 
        thread_compiler = !(device->instance->debug_flags & RADV_DEBUG_NOTHREADLLVM);