summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86TargetMachine.cpp
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-08-13 18:15:52 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-08-13 18:15:52 +0000
commit02cbe2824c560cd0333d5fe909293436f6ebd6ef (patch)
treef119b1f459a13cc9170030ce071da3f12f47b644 /llvm/lib/Target/X86/X86TargetMachine.cpp
parent1a6f2b83ab6534e265310557a2a1277d3b47c079 (diff)
downloadbcm5719-llvm-02cbe2824c560cd0333d5fe909293436f6ebd6ef.tar.gz
bcm5719-llvm-02cbe2824c560cd0333d5fe909293436f6ebd6ef.zip
addPassesToJITCompile now takes a FunctionPassManager, to support
function-at-a-time compilation and emission of code. Separate addPassesToEmitAssembly from addPassesToJITCompile, because the latter requires you to use FunctionPasses, and the former might diverge anyway. llvm-svn: 7817
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/X86/X86TargetMachine.cpp41
1 files changed, 39 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp
index 2de30f7245d..e3cc88078cf 100644
--- a/llvm/lib/Target/X86/X86TargetMachine.cpp
+++ b/llvm/lib/Target/X86/X86TargetMachine.cpp
@@ -48,7 +48,44 @@ X86TargetMachine::X86TargetMachine(unsigned Config)
// does to emit statically compiled machine code.
bool X86TargetMachine::addPassesToEmitAssembly(PassManager &PM,
std::ostream &Out) {
- addPassesToJITCompile(PM);
+ // FIXME: Implement the switch instruction in the instruction selector!
+ PM.add(createLowerSwitchPass());
+
+ if (NoPatternISel)
+ PM.add(createX86SimpleInstructionSelector(*this));
+ else
+ PM.add(createX86PatternInstructionSelector(*this));
+
+ // TODO: optional optimizations go here
+
+ // FIXME: Add SSA based peephole optimizer here.
+
+ // Print the instruction selected machine code...
+ if (PrintCode)
+ PM.add(createMachineFunctionPrinterPass());
+
+ // Perform register allocation to convert to a concrete x86 representation
+ if (NoLocalRA)
+ PM.add(createSimpleRegisterAllocator());
+ else
+ PM.add(createLocalRegisterAllocator());
+
+ if (PrintCode)
+ PM.add(createMachineFunctionPrinterPass());
+
+ PM.add(createX86FloatingPointStackifierPass());
+
+ if (PrintCode)
+ PM.add(createMachineFunctionPrinterPass());
+
+ // Insert prolog/epilog code. Eliminate abstract frame index references...
+ PM.add(createPrologEpilogCodeInserter());
+
+ PM.add(createX86PeepholeOptimizerPass());
+
+ if (PrintCode) // Print the register-allocated code
+ PM.add(createX86CodePrinterPass(std::cerr, *this));
+
PM.add(createX86CodePrinterPass(Out, *this));
return false; // success!
}
@@ -57,7 +94,7 @@ bool X86TargetMachine::addPassesToEmitAssembly(PassManager &PM,
/// implement a fast dynamic compiler for this target. Return true if this is
/// not supported for this target.
///
-bool X86TargetMachine::addPassesToJITCompile(PassManager &PM) {
+bool X86TargetMachine::addPassesToJITCompile(FunctionPassManager &PM) {
// FIXME: Implement the switch instruction in the instruction selector!
PM.add(createLowerSwitchPass());
OpenPOWER on IntegriCloud