Follow a similar pattern as AMDGPUDAGToDAGISel's constructor so that we
can use INITIALIZE_PASS to register a pass. This allows for more fine
grain testability of SelectionDAGISel.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm happy to go through the other architectures and make similar changes if folks are happy with this direction.
Another thought: should I go though and change SelectionDAGISel's constructor to accept a pointer to the TargetMachine (or std::optional)?
llvm/include/llvm/InitializePasses.h | ||
---|---|---|
421 ↗ | (On Diff #484012) | This decl should probably go in llvm/lib/Target/X86/X86.h instead. |
If I rebase this onto https://reviews.llvm.org/D140349, I can drop some of the diffs I just immediately undo there.
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | ||
---|---|---|
179–180 | Q: Is it necessary to override getPassName if the pass is registered? I thought the default implementation would extract the pass name from the registration info. |
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | ||
---|---|---|
179–180 | A: No, but you can make it "more infomative": |
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | ||
---|---|---|
179–180 | Makes sense, thank you. |
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | ||
---|---|---|
179–180 | oh, if I remove it, I get the same result from llc -print-before-all. |
drop this after moving the initialize function to X86.h