[llvm] [CodeGen][NPM] Support generic regalloc-npm option (PR #172485)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 31 20:39:28 PST 2025
boomanaiden154 wrote:
> We'd greatly appreciate any thoughts/suggestions on this approach.
I was proposing not having any restrictions on what passes could be added through `--regalloc-npm`.
Fundamentally, it seems like we just want to override the pipelines in `addPreRegAlloc` and `addOptimizedRegAlloc` from the command line. If we drop all the regalloc specific handling, that just becomes a flag where we pass the value to `parsePassPipeline` and add it. What I'm trying to get at is why the additional complexity for all this generic regalloc specific handling is justified. In my mind, an AMDGPU specific flag that just runs `parsePassPipeline` over the flag in `AMDGPUCodegenPassBuilder` within `addOptimizedRegalloc`/`addFastRegalloc` (or maybe a more fine grained overload) would also work with a slight DevUX regression (we lose the ability to specify `default` and do not get nice errors if we try to add non-regalloc passes). But given the small number of tests, it might seem like that would be the better option.
Of course if that makes things significantly more difficult/drastically increases maintenance costs, it might not make sense to do that, but that's not what I am seeing here.
https://github.com/llvm/llvm-project/pull/172485
More information about the llvm-commits
mailing list