LLVM fix (skylake) (#2269)

This commit is contained in:
Ivan 2017-01-21 23:40:37 +03:00 committed by GitHub
parent fbf8231642
commit fb56c14853
2 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,7 @@ dist: trusty
os: os:
- linux - linux
- osx # - osx
osx_image: xcode6.4 osx_image: xcode6.4

View File

@ -245,13 +245,14 @@ jit_compiler::jit_compiler(std::unique_ptr<llvm::Module>&& _module, std::unorder
llvm::InitializeNativeTarget(); llvm::InitializeNativeTarget();
llvm::InitializeNativeTargetAsmPrinter(); llvm::InitializeNativeTargetAsmPrinter();
LLVMLinkInMCJIT(); LLVMLinkInMCJIT();
const auto _cpu = llvm::sys::getHostCPUName();
m_engine.reset(llvm::EngineBuilder(std::move(_module)) m_engine.reset(llvm::EngineBuilder(std::move(_module))
.setErrorStr(&result) .setErrorStr(&result)
.setMCJITMemoryManager(std::make_unique<MemoryManager>(std::move(table))) .setMCJITMemoryManager(std::make_unique<MemoryManager>(std::move(table)))
.setOptLevel(llvm::CodeGenOpt::Aggressive) .setOptLevel(llvm::CodeGenOpt::Aggressive)
.setCodeModel((u64)s_memory <= 0x60000000 ? llvm::CodeModel::Small : llvm::CodeModel::Large) // TODO .setCodeModel((u64)s_memory <= 0x60000000 ? llvm::CodeModel::Small : llvm::CodeModel::Large) // TODO
.setMCPU(llvm::sys::getHostCPUName()) .setMCPU(_cpu == "skylake" ? "haswell" : _cpu)
.create()); .create());
if (!m_engine) if (!m_engine)