Commit 3b521a90 authored by Jaikrishnan Menon's avatar Jaikrishnan Menon

CPU: Enable an initial set of target features for Eigen

parent 4ab74ea4
...@@ -139,6 +139,9 @@ std::unique_ptr<llvm::Module> execution_state::compile(const string& source, con ...@@ -139,6 +139,9 @@ std::unique_ptr<llvm::Module> execution_state::compile(const string& source, con
LO->CXXExceptions = 1; LO->CXXExceptions = 1;
LO->WChar = 1; LO->WChar = 1;
LO->RTTI = 1; LO->RTTI = 1;
// Enable OpenMP for Eigen
LO->OpenMP = 1;
LO->OpenMPUseTLS = 1;
if (debuginfo_enabled) if (debuginfo_enabled)
{ {
...@@ -155,6 +158,15 @@ std::unique_ptr<llvm::Module> execution_state::compile(const string& source, con ...@@ -155,6 +158,15 @@ std::unique_ptr<llvm::Module> execution_state::compile(const string& source, con
PPO.DisablePCHValidation = 1; PPO.DisablePCHValidation = 1;
} }
// Enable various target features
// Most of these are for Eigen
auto &TO = Clang->getInvocation().getTargetOpts();
TO.FeaturesAsWritten.emplace_back("+sse4.1");
TO.FeaturesAsWritten.emplace_back("+sse4.2");
TO.FeaturesAsWritten.emplace_back("+avx");
TO.FeaturesAsWritten.emplace_back("+avx2");
TO.FeaturesAsWritten.emplace_back("+fma");
// Map code filename to a memoryBuffer // Map code filename to a memoryBuffer
StringRef source_ref(source); StringRef source_ref(source);
unique_ptr<MemoryBuffer> buffer = MemoryBuffer::getMemBufferCopy(source_ref); unique_ptr<MemoryBuffer> buffer = MemoryBuffer::getMemBufferCopy(source_ref);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment