diff options
author | Matthias Braun <matze@braunis.de> | 2016-08-24 01:52:46 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2016-08-24 01:52:46 +0000 |
commit | 733fe3676c629b25edcae79d3ba3ccb24e6c6cb3 (patch) | |
tree | 578f14b815a159c1fef147071e29daec739115f0 /llvm/unittests | |
parent | bceadcf1cd8f8128c92b1b2f3d4a11ba85f480cb (diff) | |
download | llvm-733fe3676c629b25edcae79d3ba3ccb24e6c6cb3.zip llvm-733fe3676c629b25edcae79d3ba3ccb24e6c6cb3.tar.gz llvm-733fe3676c629b25edcae79d3ba3ccb24e6c6cb3.tar.bz2 |
CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePasses
Re-apply this patch, hopefully I will get away without any warnings
in the constructor now.
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
llvm-svn: 279602
Diffstat (limited to 'llvm/unittests')
-rw-r--r-- | llvm/unittests/MI/LiveIntervalTest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/unittests/MI/LiveIntervalTest.cpp b/llvm/unittests/MI/LiveIntervalTest.cpp index 9f594e5..1d6df97 100644 --- a/llvm/unittests/MI/LiveIntervalTest.cpp +++ b/llvm/unittests/MI/LiveIntervalTest.cpp @@ -69,9 +69,9 @@ std::unique_ptr<Module> parseMIR(LLVMContext &Context, if (!F) return nullptr; - PM.add(new MachineModuleInfo(&TM)); - const LLVMTargetMachine &LLVMTM = static_cast<const LLVMTargetMachine&>(TM); - LLVMTM.addMachineFunctionAnalysis(PM, MIR.get()); + MachineModuleInfo *MMI = new MachineModuleInfo(&TM); + MMI->setMachineFunctionInitializer(MIR.get()); + PM.add(MMI); return M; } |