[llvm] [SelectionDAG] Add a flag to filter ISel traces by function names (PR #72696)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 14:25:16 PST 2023


================
@@ -142,6 +142,12 @@ UseMBPI("use-mbpi",
         cl::init(true), cl::Hidden);
 
 #ifndef NDEBUG
+static cl::list<std::string> FilterDAGFuncNames(
+    "filter-print-dags-funcs", cl::Hidden, cl::value_desc("function names"),
+    cl::desc("Only print DAGs of functions whose names "
----------------
mshockwave wrote:

> If you only want to see the dumps from CodeGenAndEmitDAG(), then maybe those should be given their own DEBUG_TYPE separate from the rest of this file. So you could do -debug-only=isel-dumps -filter-print-dags-funcs=

Printing traces in CodeGenAndEmitDAG is my primary goal, so I'm probably going with the `-debug-only=isel-dumps` + filter function flag approach.

> it feels very similar to -filter-print-funcs=... can we just reuse that? IMO asking for a dump of the DAG + -filter-print-funcs= seems natural

Sounds like a good idea to me. I just found that several CodeGen Passes are also using `-filter-print-funcs`.

> but maybe it's missing the desired granularity, or would it include information you'd like to exclude from the output?

I don't think these will be a problem.

https://github.com/llvm/llvm-project/pull/72696


More information about the llvm-commits mailing list