[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 21 10:47:50 PST 2020


aeubanks added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/MachinePassRegistry.def:38-47
+FUNCTION_PASS("mergeicmps", MergeICmpsPass, ())
+FUNCTION_PASS("lower-constant-intrinsics", LowerConstantIntrinsicsPass, ())
+FUNCTION_PASS("unreachableblockelim", UnreachableBlockElimPass, ())
+FUNCTION_PASS("consthoist", ConstantHoistingPass, ())
+FUNCTION_PASS("partially-inline-libcalls", PartiallyInlineLibCallsPass, ())
+FUNCTION_PASS("ee-instrument", EntryExitInstrumenterPass, (false))
+FUNCTION_PASS("post-inline-ee-instrument", EntryExitInstrumenterPass, (true))
----------------
aeubanks wrote:
> Is the intention that codegen IR passes will exist in both PassRegistry.def and MachinePassRegistry.def? Since people still generally use `opt` to test those passes.
Oh I finally noticed the `AddIRPasses`. Maybe using a `PassBuilder` with backends doing something similar to `registerPassBuilderCallbacks` would require less duplicated code to parse user pipelines? Not sure if we'd really need the assert that module passes must come before function passes.


================
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"
----------------
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)


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