diff options
author | Matthias Braun <matze@braunis.de> | 2016-08-23 03:20:09 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2016-08-23 03:20:09 +0000 |
commit | ded269b90730de1fe6a06667eb428e9989683c27 (patch) | |
tree | e33f5245a7eda66c90b3e02c465a12046708487e /tools/llc | |
parent | 5f3b1be4e177f0f4cb6a5d8510b3b1e0b2767770 (diff) |
CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePasses
This patch removes the MachineFunctionAnalysis. Instead we keep a
map from IR Function to MachineFunction in the MachineModuleInfo.
This allows the insertion of ModulePasses into the codegen pipeline
without breaking it because the MachineFunctionAnalysis gets dropped
before a module pass.
Peak memory should stay unchanged without a ModulePass in the codegen
pipeline: Previously the MachineFunction was freed at the end of a codegen
function pipeline because the MachineFunctionAnalysis was dropped; With
this patch the MachineFunction is freed after the AsmPrinter has
finished.
Differential Revision: http://reviews.llvm.org/D23736
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279502 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llc')
-rw-r--r-- | tools/llc/llc.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 250d2765104..22273d4b2d0 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -450,8 +450,7 @@ static int compileModule(char **argv, LLVMContext &Context) { LLVMTargetMachine &LLVMTM = static_cast<LLVMTargetMachine&>(*Target); TargetPassConfig &TPC = *LLVMTM.createPassConfig(PM); PM.add(&TPC); - LLVMTM.addMachineModuleInfo(PM); - LLVMTM.addMachineFunctionAnalysis(PM, MIR.get()); + LLVMTM.addMachineModuleInfo(PM, MIR.get()); TPC.printAndVerify(""); for (const std::string &RunPassName : *RunPassNames) { |