[all-commits] [llvm/llvm-project] bb531c: [NewPM/Codegen] Move MachineModuleInfo ownership o...

Arthur Eubanks via All-commits all-commits at lists.llvm.org
Wed Feb 7 09:15:55 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bb531c9a0068a078c5bbe95298769b235aa1ad75
      https://github.com/llvm/llvm-project/commit/bb531c9a0068a078c5bbe95298769b235aa1ad75
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   2024-02-07 (Wed, 07 Feb 2024)

  Changed paths:
    M llvm/include/llvm/CodeGen/MachineModuleInfo.h
    M llvm/lib/CodeGen/MachineModuleInfo.cpp
    M llvm/lib/CodeGen/MachinePassManager.cpp
    M llvm/tools/llc/NewPMDriver.cpp
    M llvm/unittests/CodeGen/PassManagerTest.cpp
    M llvm/unittests/MIR/PassBuilderCallbacksTest.cpp

  Log Message:
  -----------
  [NewPM/Codegen] Move MachineModuleInfo ownership outside of analysis (#80937)

With the legacy pass manager, MachineModuleInfoWrapperPass owned the
MachineModuleInfo used in the codegen pipeline. It can do this since
it's an ImmutablePass that doesn't get invalidated.

However, with the new pass manager, it is legal for the
ModuleAnalysisManager to clear all of its analyses, regardless of if the
analysis does not want to be invalidated. So we must move ownership of
the MachineModuleInfo outside of the analysis (this is similar to
PassInstrumentation). For now, make the PassBuilder user register a
MachineModuleAnalysis that returns a reference to a MachineModuleInfo
that the user owns. Perhaps we can find a better place to own the
MachineModuleInfo to make using the codegen pass manager less cumbersome
in the future.




More information about the All-commits mailing list