[PATCH] D23736: CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePasses

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 19:03:29 PDT 2016


MatzeB created this revision.
MatzeB added reviewers: jmolloy, chandlerc, hfinkel, bogner, rengolin, qcolombet.
MatzeB added subscribers: llvm-commits, jpaquette.
MatzeB set the repository for this revision to rL LLVM.
Herald added a reviewer: tstellarAMD.
Herald added subscribers: mcrosier, arsenm, MatzeB, jholewinski.

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.


Note that this is not complete yet. It works nice without a ModulePass in the codegen pipeline. It works in many cases with a ModulePass, but still fails in some instances because have some metadata about the current function in MachineModuleInfo which needs to be moved into the MachineFunction class.

Repository:
  rL LLVM

https://reviews.llvm.org/D23736

Files:
  include/llvm/CodeGen/AsmPrinter.h
  include/llvm/CodeGen/MachineFunctionAnalysis.h
  include/llvm/CodeGen/MachineModuleInfo.h
  include/llvm/Target/TargetMachine.h
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  lib/CodeGen/CMakeLists.txt
  lib/CodeGen/LLVMTargetMachine.cpp
  lib/CodeGen/MachineFunctionAnalysis.cpp
  lib/CodeGen/MachineFunctionPass.cpp
  lib/CodeGen/MachineModuleInfo.cpp
  lib/CodeGen/StackMapLivenessAnalysis.cpp
  lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
  lib/Target/Hexagon/HexagonCommonGEP.cpp
  lib/Target/Hexagon/HexagonGenExtract.cpp
  lib/Target/Hexagon/HexagonNewValueJump.cpp
  lib/Target/Hexagon/HexagonOptimizeSZextends.cpp
  lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
  lib/Target/NVPTX/NVPTXAllocaHoisting.cpp
  lib/Target/NVPTX/NVPTXGenericToNVVM.cpp
  lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp
  lib/Target/NVPTX/NVPTXTargetMachine.cpp
  test/CodeGen/Generic/stop-after.ll
  test/CodeGen/X86/hidden-vis-pic.ll
  tools/llc/llc.cpp
  unittests/MI/LiveIntervalTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23736.68760.patch
Type: text/x-patch
Size: 23943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160820/4a525705/attachment.bin>


More information about the llvm-commits mailing list