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 4ad5e72d79d2fdef0ea9789551e3d1acbe6c1f3f..3177347eab5d633631cfc48145abf43926e30d52 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 10a931b150f2fa31beb3d1976a9551488aa5800c..62e163b0057433f7d6354f40a223f4f73c421039 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 f9650bdf4f1b024293bd64aa1a3920b1b306f899..1d90a6a1a03394530435a601602bb4ce9360103c 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 557e402105f819c43797b5d387fb37a151da31b9..df7d4d2374f338ee05beac43ec1aefe9ff459011 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 84f7707def9fd214628b2cb1d9169475ecffd35c..ef309249fd8c6ad6ce9349d211afcacce3f654a3 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 6ad327b2003efe5aed6641c147d1e00963ff6383..987d10543567639240410de262ec900cda373621 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);