This fixes AMDGPU GlobalISel test failures when enabling the AMDGPU
target without any other targets that use GlobalISel.
Details
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 16808 Build 16808: arc lint + arc unit
Event Timeline
I'm not sure, that's just what the other targets are doing. Maybe putting this in initializeCodeGen() would be better?
Is GlobalISel in a separate library? I'm not sure exactly why the initialize* functions are split up the way they are.
It is a separate library. My guess is that the targets started doing it this way back when GlobalISel was an optional library to minimize the number of places that needed ifdef LLVM_BUILD_GLOBAL_ISEL .
My guess is it was just copying how SelectionDAG worked where each target owned the actual pass, so it had to be initialized there. I'm guessing this should probably be called wherever initializeCodeGen is called, but maybe not in it
I'm not sure why it's still separate but having it separate means that compilers with only targets that don't implement GlobalISel don't spend time initializing the passes for it. I think Tom's guess about minimizing LLVM_BUILD_GLOBAL_ISEL is probably the original reason.
This patch LGTM