diff options
Diffstat (limited to 'lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r-- | lib/Target/X86/X86TargetMachine.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index 7075a3324a..db846651fc 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -6,9 +6,9 @@ #include "X86TargetMachine.h" #include "X86.h" -#include "llvm/Transforms/Scalar.h" #include "llvm/Target/TargetMachineImpls.h" #include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/Passes.h" #include "llvm/PassManager.h" #include "Support/CommandLine.h" #include "Support/Statistic.h" @@ -40,21 +40,17 @@ X86TargetMachine::X86TargetMachine(unsigned Config) FrameInfo(TargetFrameInfo::StackGrowsDown, 1/*16*/, 0) { } - /// addPassesToJITCompile - Add passes to the specified pass manager to /// implement a fast dynamic compiler for this target. Return true if this is /// not supported for this target. /// bool X86TargetMachine::addPassesToJITCompile(PassManager &PM) { - // For the moment we have decided that malloc and free will be - // taken care of by converting them to calls, using the existing - // LLVM scalar transforms pass to do this. - PM.add(createLowerAllocationsPass()); - PM.add(createSimpleX86InstructionSelector(*this)); // TODO: optional optimizations go here + // FIXME: Add SSA based peephole optimizer here. + // Print the instruction selected machine code... if (PrintCode) PM.add(createMachineFunctionPrinterPass()); @@ -68,14 +64,19 @@ bool X86TargetMachine::addPassesToJITCompile(PassManager &PM) { 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)); - PM.add(createMachineCodeDestructionPass()); - return false; // success! } |