aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/JIT/JIT.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r--lib/ExecutionEngine/JIT/JIT.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp
index 2e7236b5d5..fd41c4c127 100644
--- a/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/lib/ExecutionEngine/JIT/JIT.cpp
@@ -11,6 +11,9 @@
#include "llvm/Module.h"
#include "Support/CommandLine.h"
+// FIXME: REMOVE THIS
+#include "llvm/PassManager.h"
+
namespace {
cl::opt<std::string>
Arch("march", cl::desc("Architecture: `x86' or `sparc'"), cl::Prefix,
@@ -27,7 +30,6 @@ namespace {
}
-
/// createJIT - Create an return a new JIT compiler if there is one available
/// for the current target. Otherwise it returns null.
///
@@ -65,6 +67,17 @@ VM::VM(Module *M, TargetMachine *tm) : ExecutionEngine(M), TM(*tm) {
MCE = createEmitter(*this);
setupPassManager();
+
+ // THIS GOES BEYOND UGLY HACKS
+ if (TM.getName() == "UltraSparc-Native") {
+ extern Pass *createPreSelectionPass(TargetMachine &TM);
+ PassManager PM;
+ // Specialize LLVM code for this target machine and then
+ // run basic dataflow optimizations on LLVM code.
+ PM.add(createPreSelectionPass(TM));
+ PM.run(*M);
+ }
+
emitGlobals();
}