[llvm] [NewPM][CodeGen] add TargetPassConfig like API (PR #70906)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 19 00:20:37 PST 2023
================
@@ -17,6 +17,51 @@
using namespace llvm;
+namespace {
+
+/// RAII class to replace addMachinePrePasses/addMachinePostPasses
+/// If we need more complex logics, consider add class like
+/// CodeGenInstrumentation
+// TODO: skip FreeMachineFunctionPass and AsmPrinter
+class PrePostPasses {
----------------
paperchalice wrote:
Yes, put them in instrument would be a better choice. Currently the IR pass instrument cannot distinguish between machine module (or machine module info) and IR module, because it always passes module to the callbacks in current implementation.
https://github.com/llvm/llvm-project/blob/5caae72d1a4f58c9525977a93d86c3c833da4b34/llvm/lib/CodeGen/MachinePassManager.cpp#L62C8-L67
Anyway, I will add some instruments that belongs to codegen, e.g. verifier, which needs a different initializer, because it needs some analysis information.
https://github.com/llvm/llvm-project/pull/70906
More information about the llvm-commits
mailing list