This is a hook to allow TargetMachine to install passes at the
EP_EarlyAsPossible PassManagerBuilder extension point.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I feel like it would be useful to implement this at least for one target (I'm assuming NVPTX) to show the use case before landing it...
Yes, see D18616.
(The problem, it seems to me, is that we ask people to aggressively split up patches but then don't have a good way to give reviewers the full context. I can manually go in to Phabricator and set the depends-on metadata, but when I'm posting a dozen small patches, the relative time cost of doing that is huge. It needs to Happen Automatically.)
Chandler, are you happy with this? It seemed like the main problem was that I hadn't linked to D18616 originally.
include/llvm/Target/TargetMachine.h | ||
---|---|---|
223 ↗ | (On Diff #52097) | Where do you call this function? |
Shouldn't this patch also modify the pass pipeline to call this hook at some point?
include/llvm/Target/TargetMachine.h | ||
---|---|---|
220–221 ↗ | (On Diff #52097) | Maybe this should say "before all mid-level optimization passes". I initially assumed you wanted this to run before IR-level codegen passes (CodeGenPrepare, LSR, etc), but that's what we have today. |
lgtm
include/llvm/Target/TargetMachine.h | ||
---|---|---|
223 ↗ | (On Diff #55264) | As discussed, we should call it from opt as well, then. opt should have a TargetMachine somewhere. |