File tree Expand file tree Collapse file tree 1 file changed +8
-27
lines changed Expand file tree Collapse file tree 1 file changed +8
-27
lines changed Original file line number Diff line number Diff line change @@ -50,36 +50,17 @@ extern JuliaOJIT *jl_ExecutionEngine;
5050namespace {
5151
5252static bool have_fp16 (Function &caller, const Triple &TT) {
53- Attribute FSAttr = caller.getFnAttribute (" target-features" );
54- StringRef FS = " " ;
55- if (FSAttr.isValid ())
56- FS = FSAttr.getValueAsString ();
57- else if (jl_ExecutionEngine)
58- FS = jl_ExecutionEngine->getTargetFeatureString ();
59- // else probably called from opt, just do nothing
60- if (TT.isAArch64 ()) {
61- if (FS.find (" +fp16fml" ) != llvm::StringRef::npos || FS.find (" +fullfp16" ) != llvm::StringRef::npos){
62- return true ;
63- }
64- } else if (TT.getArch () == Triple::x86_64) {
65- if (FS.find (" +avx512fp16" ) != llvm::StringRef::npos){
66- return true ;
67- }
68- }
69- if (caller.hasFnAttribute (" julia.hasfp16" )) {
70- return true ;
71- }
72- return false ;
53+ // llvm/llvm-project#97975: on some platforms, `half` uses excessive precision
54+ if (TT.isPPC ())
55+ return false ;
56+
57+ return true ;
7358}
7459
7560static bool have_bf16 (Function &caller, const Triple &TT) {
76- if (caller.hasFnAttribute (" julia.hasbf16" )) {
77- return true ;
78- }
79-
80- // there's no targets that fully support bfloat yet;,
81- // AVX512BF16 only provides conversion and dot product instructions.
82- return false ;
61+ // https://github.com/llvm/llvm-project/issues/97975#issuecomment-2218770199:
62+ // on current versions of LLVM, bf16 always uses TypeSoftPromoteHalf
63+ return true ;
8364}
8465
8566static bool demoteFloat16 (Function &F)
You can’t perform that action at this time.
0 commit comments