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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 13:08:02 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 "
----------------
topperc wrote:

I think we should take a step back and figure out what the goal of `-debug-only=isel -filter-print-dags-funcs=` is.

This patch seems to have touched every debug message in this file, but this isn't the only SelectionDAG file.

Are you just wanting to see the dumps of the DAG from  `CodeGenAndEmitDAG()` for a specific function? Do you care about any of the other messages for that function? Its not clear that you'd only want those debug messages in this file and not the other SelectionDAG files. Since the split between files isn't completely clean.

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=`

If you want all debug messages for a particular function then maybe this property should live on SelectionDAG and filter all of the messages in all of the SelectionDAG related files?

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


More information about the llvm-commits mailing list