#if LLVM_VERSION_MAJOR >= 10
/* Atomic optimizations require LLVM 10.0 for gfx10 support. */
"-amdgpu-atomic-optimizations=true",
+#endif
+#if LLVM_VERSION_MAJOR >= 11
+ /* This was disabled by default in: https://reviews.llvm.org/D77228 */
+ "-structurizecfg-skip-uniform-regions",
#endif
};
LLVMParseCommandLineOptions(ARRAY_SIZE(argv), argv, NULL);
}
-static once_flag ac_init_llvm_target_once_flag = ONCE_FLAG_INIT;
+PUBLIC void ac_init_shared_llvm_once(void)
+{
+ static once_flag ac_init_llvm_target_once_flag = ONCE_FLAG_INIT;
+ call_once(&ac_init_llvm_target_once_flag, ac_init_llvm_target);
+}
+
+#if !LLVM_IS_SHARED
+static once_flag ac_init_static_llvm_target_once_flag = ONCE_FLAG_INIT;
+static void ac_init_static_llvm_once(void)
+{
+ call_once(&ac_init_static_llvm_target_once_flag, ac_init_llvm_target);
+}
+#endif
void ac_init_llvm_once(void)
{
- call_once(&ac_init_llvm_target_once_flag, ac_init_llvm_target);
+#if LLVM_IS_SHARED
+ ac_init_shared_llvm_once();
+#else
+ ac_init_static_llvm_once();
+#endif
}
static LLVMTargetRef ac_get_llvm_target(const char *triple)
return "gfx1011";
case CHIP_NAVI14:
return "gfx1012";
+ case CHIP_SIENNA_CICHLID:
+ case CHIP_NAVY_FLOUNDER:
+ return "gfx1030";
default:
return "";
}
LLVMTargetRef target = ac_get_llvm_target(triple);
snprintf(features, sizeof(features),
- "+DumpCode,-fp32-denormals,+fp64-denormals%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" : "",
- tm_options & AC_TM_SISCHED ? ",+si-scheduler" : "",
- tm_options & AC_TM_FORCE_ENABLE_XNACK ? ",+xnack" : "",
- 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" : "");
+ 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" : "");
LLVMTargetMachineRef tm = LLVMCreateTargetMachine(
target,