sync with OpenBSD -current
This commit is contained in:
parent
1fd36b57f8
commit
d263854dd3
2 changed files with 11 additions and 2 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <llvm/Analysis/TargetLibraryInfo.h>
|
||||
#include <llvm/IR/IRBuilder.h>
|
||||
#include <llvm/IR/LegacyPassManager.h>
|
||||
#include <llvm/IR/Module.h>
|
||||
#include <llvm/IR/Verifier.h>
|
||||
#include <llvm/Target/TargetMachine.h>
|
||||
#include <llvm/MC/MCSubtargetInfo.h>
|
||||
|
|
|
@ -402,8 +402,14 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
|
|||
* which allows us to enable/disable code generation based
|
||||
* on the results of cpuid on these architectures.
|
||||
*/
|
||||
llvm::StringMap<bool> features;
|
||||
llvm::sys::getHostCPUFeatures(features);
|
||||
#if LLVM_VERSION_MAJOR >= 19
|
||||
/* llvm-19+ returns StringMap from getHostCPUFeatures.
|
||||
*/
|
||||
auto features = llvm::sys::getHostCPUFeatures();
|
||||
#else
|
||||
llvm::StringMap<bool> features;
|
||||
llvm::sys::getHostCPUFeatures(features);
|
||||
#endif
|
||||
|
||||
for (StringMapIterator<bool> f = features.begin();
|
||||
f != features.end();
|
||||
|
@ -443,8 +449,10 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
|
|||
/* All avx512 have avx512f */
|
||||
MAttrs.push_back(util_get_cpu_caps()->has_avx512f ? "+avx512f" : "-avx512f");
|
||||
MAttrs.push_back(util_get_cpu_caps()->has_avx512cd ? "+avx512cd" : "-avx512cd");
|
||||
#if LLVM_VERSION_MAJOR < 19
|
||||
MAttrs.push_back(util_get_cpu_caps()->has_avx512er ? "+avx512er" : "-avx512er");
|
||||
MAttrs.push_back(util_get_cpu_caps()->has_avx512pf ? "+avx512pf" : "-avx512pf");
|
||||
#endif
|
||||
MAttrs.push_back(util_get_cpu_caps()->has_avx512bw ? "+avx512bw" : "-avx512bw");
|
||||
MAttrs.push_back(util_get_cpu_caps()->has_avx512dq ? "+avx512dq" : "-avx512dq");
|
||||
MAttrs.push_back(util_get_cpu_caps()->has_avx512vl ? "+avx512vl" : "-avx512vl");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue