X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FLLVMTargetMachine.cpp;h=a62f0f6caae663e2a1699d096607da44c4b15681;hb=678d9b7ed030dd79ed5ac749b0b21b6cb0859cd0;hp=75e45efe4de143657e05f26b0d4b694811dcc97c;hpb=11d53c129fc9c2a4510605ec0a1696f58750af52;p=oota-llvm.git diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index 75e45efe4de..a62f0f6caae 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -123,18 +123,15 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, const MCAsmInfo &MAI = *getMCAsmInfo(); OwningPtr AsmStreamer; - formatted_raw_ostream *LegacyOutput; switch (FileType) { default: return true; case CGFT_AssemblyFile: { MCInstPrinter *InstPrinter = - getTarget().createMCInstPrinter(MAI.getAssemblerDialect(), MAI, Out); + getTarget().createMCInstPrinter(MAI.getAssemblerDialect(), MAI); AsmStreamer.reset(createAsmStreamer(*Context, Out, getTargetData()->isLittleEndian(), getVerboseAsm(), InstPrinter, /*codeemitter*/0)); - // Set the AsmPrinter's "O" to the output file. - LegacyOutput = &Out; break; } case CGFT_ObjectFile: { @@ -146,29 +143,17 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, return true; AsmStreamer.reset(createMachOStreamer(*Context, *TAB, Out, MCE)); - - // Any output to the asmprinter's "O" stream is bad and needs to be fixed, - // force it to come out stderr. - // FIXME: this is horrible and leaks, eventually remove the raw_ostream from - // asmprinter. - LegacyOutput = new formatted_raw_ostream(errs()); break; } case CGFT_Null: // The Null output is intended for use for performance analysis and testing, // not real users. AsmStreamer.reset(createNullStreamer(*Context)); - // Any output to the asmprinter's "O" stream is bad and needs to be fixed, - // force it to come out stderr. - // FIXME: this is horrible and leaks, eventually remove the raw_ostream from - // asmprinter. - LegacyOutput = new formatted_raw_ostream(errs()); break; } // Create the AsmPrinter, which takes ownership of AsmStreamer if successful. - FunctionPass *Printer = - getTarget().createAsmPrinter(*LegacyOutput, *this, *AsmStreamer); + FunctionPass *Printer = getTarget().createAsmPrinter(*this, *AsmStreamer); if (Printer == 0) return true; @@ -358,6 +343,9 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM, // kill markers. PM.add(createStackSlotColoringPass(false)); printAndVerify(PM, "After StackSlotColoring"); + + // Run post-ra machine LICM to hoist reloads / remats. + PM.add(createMachineLICMPass(false)); } // Run post-ra passes.