nir/algebraic: Print out the list of transforms in the C file
authorJason Ekstrand <jason@jlekstrand.net>
Sat, 13 Jul 2019 15:57:24 +0000 (10:57 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 17 Jul 2019 18:44:35 +0000 (18:44 +0000)
This helps greatly when debugging algebraic transform generators because
you can now actually see the output and verify that your transforms are
getting generated.

Acked-by: Matt Turner <mattst88@gmail.com>
src/compiler/nir/nir_algebraic.py

index e79fa3cec5ea9d697a5762befddcf1b494ddda80..9b8af1a7470ce7ec7626d56528fb9e22fc669913 100644 (file)
@@ -1034,6 +1034,13 @@ _algebraic_pass_template = mako.template.Template("""
 #include "nir_search.h"
 #include "nir_search_helpers.h"
 
+/* What follows is NIR algebraic transform code for the following ${len(xforms)}
+ * transforms:
+% for xform in xforms:
+ *    ${xform.search} => ${xform.replace}
+% endfor
+ */
+
 #ifndef NIR_OPT_ALGEBRAIC_STRUCT_DEFS
 #define NIR_OPT_ALGEBRAIC_STRUCT_DEFS