<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/94141>94141</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [NewPM][CodeGen] Enable new pass manager codegen pipeline for BPF
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:BPF,
            llvm:codegen
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          paperchalice
      </td>
    </tr>
</table>

<pre>
    We should enable a constrained `O0` pipeline to generate object file ASAP. Although how to build codegen pipeline is still controversial (#89708), we still can port the rest machine function passes to generate object file.

BPF might be the simplest target in non-experimental targets, this might be a good place to start, but tests in BPF check only  asm code, this is bad for testing.

CC @aeubanks 

---
TODO list:
- [ ] BPF `CodeGenPassBuilder` support
- [ ] BPF DAG->DAG Pattern Instruction Selection `bpf-isel`
- [ ] Finalize ISel and expand pseudo-instructions `finalize-isel`
- [ ] Local Stack Slot Allocation `local-stack-alloc`
- [ ] Register allocation
   - [ ] Eliminate PHI nodes for register allocation `phi-node-elimination`
   - [ ] Two-Address instruction pass `two-address-instruction`
   - [ ] Fast Register Allocator `reg-alloc<fast>`
- [ ] Fixup Statepoint Caller Saved `fixup-statepoint-caller-saved`
- [ ] Prologue/Epilogue Insertion & Frame Finalization `prolog-epilog`
- [ ] Post-RA pseudo instruction expansion pass `post-ra-pseudos`
- [ ] BPF PreEmit Checking `bpf-mi-checking`
- [ ] Assembly Printer `asm-printer`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VU1v4zgM_TXKhXAgKx-NDznko-4W2N0GkwH2TNuMra0sGaLctPvrF7KTSTuTucSK-fhIPT3RyKxrS7QWi61Y7CfYh8b5dYcd-bJBo0uaFK76WP9DwI3rTQVksTAECKWzHDxqSxWIpXyRYimh0x0ZbQmCg5oseQwErviXygAnbQg2x81hChsTGtfXDTTuHKFFr00Fpauo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