[llvm] [AMDGPU] Move AMDGPUTargetMachine into AMDGPUCodeGenPassBuilder(NFC) (PR #103720)
Christudasan Devadasan via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 14 06:43:21 PDT 2024
cdevadas wrote:
> > Certain options and static declarations are used between TM and TargetPassConfig. So moving CodeGenPassBuilder into AMDGPU TM is the viable option to avoid extern declarations of various common options.
>
> Do you mean the few fields that use cl::location in the TargetMachine? I think we can just delete those at this point.
Not just that. `AMDGPUTargetMachine::registerPassBuilderCallbacks` uses some callbacks like, onlyAllocateSGPRs, onlyAllocateVGPRs that are also needed for PassConfig when moved to the other file. CodeGenPassBuilder will also need these callbacks for regalloc pipeline. And this TM function also uses cmdline options like InternalizeSymbols and EnableHipStdPar which might also be required in the NPM path.
https://github.com/llvm/llvm-project/pull/103720
More information about the llvm-commits
mailing list