summaryrefslogtreecommitdiff
path: root/unittests/MI
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-08-23 03:20:09 +0000
committerMatthias Braun <matze@braunis.de>2016-08-23 03:20:09 +0000
commitded269b90730de1fe6a06667eb428e9989683c27 (patch)
treee33f5245a7eda66c90b3e02c465a12046708487e /unittests/MI
parent5f3b1be4e177f0f4cb6a5d8510b3b1e0b2767770 (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 'unittests/MI')
-rw-r--r--unittests/MI/LiveIntervalTest.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/unittests/MI/LiveIntervalTest.cpp b/unittests/MI/LiveIntervalTest.cpp
index 12c3ad66073..5fe5c916719 100644
--- a/unittests/MI/LiveIntervalTest.cpp
+++ b/unittests/MI/LiveIntervalTest.cpp
@@ -70,8 +70,7 @@ std::unique_ptr<Module> parseMIR(LLVMContext &Context,
return nullptr;
const LLVMTargetMachine &LLVMTM = static_cast<const LLVMTargetMachine&>(TM);
- LLVMTM.addMachineModuleInfo(PM);
- LLVMTM.addMachineFunctionAnalysis(PM, MIR.get());
+ LLVMTM.addMachineModuleInfo(PM, MIR.get());
return M;
}