ac: enable LLVM atomic optimizations
authorMarek Olšák <marek.olsak@amd.com>
Thu, 15 Aug 2019 20:53:34 +0000 (16:53 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 10 Sep 2019 03:43:03 +0000 (23:43 -0400)
src/amd/common/ac_llvm_util.c

index 7793926bf49e47892548661653388e28f954c678..deca5b98772b37ba35e1bd48f7f968e980cd8715 100644 (file)
@@ -59,7 +59,15 @@ static void ac_init_llvm_target()
         * This option tells the backend to fall-back to SelectionDAG and print
         * a diagnostic message if global isel fails.
         */
-       const char *argv[] = { "mesa", "-simplifycfg-sink-common=false", "-global-isel-abort=2" };
+       const char *argv[] = {
+               "mesa",
+               "-simplifycfg-sink-common=false",
+               "-global-isel-abort=2",
+#if HAVE_LLVM >= 0x1000
+               /* Atomic optimizations require LLVM 10.0 for gfx10 support. */
+               "-amdgpu-atomic-optimizations=true",
+#endif
+       };
        LLVMParseCommandLineOptions(ARRAY_SIZE(argv), argv, NULL);
 }