[all-commits] [llvm/llvm-project] 6b63c5: [NewPM][X86] Port AsmPrinter to NewPM

Aiden Grossman via All-commits all-commits at lists.llvm.org
Mon Feb 23 17:28:37 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b63c59a5855d24e441a0dcdb4371bb4f1612b7f
      https://github.com/llvm/llvm-project/commit/6b63c59a5855d24e441a0dcdb4371bb4f1612b7f
  Author: Aiden Grossman <aidengrossman at google.com>
  Date:   2026-02-23 (Mon, 23 Feb 2026)

  Changed paths:
    M llvm/include/llvm/CodeGen/AsmPrinter.h
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    M llvm/lib/Target/X86/X86AsmPrinter.cpp
    M llvm/lib/Target/X86/X86AsmPrinter.h
    M llvm/lib/Target/X86/X86CodeGenPassBuilder.cpp
    M llvm/test/CodeGen/X86/llc-pipeline-npm.ll
    A llvm/test/CodeGen/X86/npm-asmprint.ll

  Log Message:
  -----------
  [NewPM][X86] Port AsmPrinter to NewPM

This patch makes AsmPrinter work with the NewPM. We essentially create
three new passes that wrap different parts of AsmPrinter so that we can
separate out doIntialization/doFinalization without needing to
materialize all MachineFunctions at the same time. This has two main
drawbacks for now:

1. We do not transfer any state between the three new AsmPrinter passes.
   This means that debuginfo/CFI currently does not work. This will be
   fixed in future passes by moving this state to MachineModuleInfo.
2. We probably incur some overhead by needing to setup up analysis
   callbacks for every MF rather than just per module. This should not
   be large, and can be optimized in the future on top of this if
   needed.
3. This solution is not really clean. However, a lot of cleanup is going
   to be difficult to do while supporting two pass managers. Once we
   remove LegacyPM support, we can make the code much cleaner and better
   enforce invariants like a lack of state between
   doInitialization/runOnMachineFunction/doFinalization.

Reviewers: arsenm, aeubanks, paperchalice

Pull Request: https://github.com/llvm/llvm-project/pull/182797



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list