X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FX86%2FX86TargetMachine.cpp;h=7d5e5ce4e96b822f214207d21c2edf1dc395f099;hb=7d25589ee19747720a6cdb045ae442332f90bbcf;hp=50780fa61d5522af4ca4671fd25adabadd9dbc0e;hpb=3dffa7953f1c532944931c6fd77ab02ea3af00c1;p=oota-llvm.git diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index 50780fa61d5..7d5e5ce4e96 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -5,6 +5,7 @@ //===----------------------------------------------------------------------===// #include "X86TargetMachine.h" +#include "llvm/Transforms/Scalar.h" #include "llvm/Target/TargetMachineImpls.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/PassManager.h" @@ -28,6 +29,11 @@ X86TargetMachine::X86TargetMachine() : TargetMachine("X86", 1, 4, 4, 4) { /// 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 @@ -36,8 +42,12 @@ bool X86TargetMachine::addPassesToJITCompile(PassManager &PM) { PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - //PM.add(createSimpleX86RegisterAllocator(*this)); + PM.add(createSimpleX86RegisterAllocator(*this)); + + // Print the instruction selected machine code... + // PM.add(createMachineFunctionPrinterPass()); + // Print the register-allocated code PM.add(createX86CodePrinterPass(*this, std::cerr)); //PM.add(createEmitX86CodeToMemory(*this));