[PATCH] D83608: [NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen pipeline

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 28 10:14:14 PST 2020


aeubanks accepted this revision.
aeubanks added a comment.
This revision is now accepted and ready to land.

Sorry, I thought you were going to remove the TODO, otherwise LGTM.



================
Comment at: llvm/lib/CodeGen/CodeGenPassBuilder.cpp:23
+#define DUMMY_MACHINE_FUNCTION_PASS(NAME, PASS_NAME, CONSTRUCTOR)              \
+  AnalysisKey PASS_NAME::Key;
+#include "llvm/CodeGen/MachinePassRegistry.def"
----------------
ychen wrote:
> aeubanks wrote:
> > I assume this is to support one pass depending on another? As mentioned before, I believe the new PM explicitly doesn't support that (I can dig up a video where Chandler said that was a terrible idea if you want)
> This is a straightforward way to implement `TargetPassConfig::insertPass`. The alternative is to use PassRegsitery.def pass string name to uniquely identify a pass however I'd prefer the pass string name only for debugging tools. Or we could look into moving targets away from using `TargetPassConfig::insertPass` if it is possible. With that said, we could keep this design, move over the related tests, and then reconsider other choices later since this is only involving changes to `class AddMachinePass`.
`insertPass` looks very legacy PM-like, we should try to come up with a better solution, but we can do that later.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83608/new/

https://reviews.llvm.org/D83608



More information about the llvm-commits mailing list