mesa/src/glsl
Timothy Arceri e1e1b67878 glsl: don't change the varying type in validation code
There is a function dedicated to demoting unused varyings lets
trust it to do its job.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
2016-01-06 10:52:58 +11:00
..
glcpp glsl: add GL_ARB_shader_draw_parameters define 2015-12-30 18:59:18 -05:00
nir nir: extract out helper macros for running passes 2016-01-03 09:11:27 -05:00
tests glsl: reduce memory footprint of uniform_storage struct 2015-10-05 10:53:24 +11:00
.gitignore glsl/glcpp: Integrate recent glcpp-test-cr-lf test into "make check" 2014-08-07 16:08:29 -07:00
Android.gen.mk android: export the path of glsl nir headers 2015-11-20 11:18:19 +00:00
Android.mk android: build with libcxx on android lollipop 2015-06-09 12:25:50 -07:00
Makefile.am build: fix make-check after a6a6a71 2015-10-17 09:51:29 -04:00
Makefile.sources glsl: Add lowering pass for shared variable references 2015-12-09 23:50:38 -08:00
README glsl: Improve precision of mod(x,y) 2015-02-03 13:19:36 +01:00
SConscript scons: Build nir/glsl_types.cpp once. 2015-10-19 15:59:59 +01:00
TODO
ast.h glsl: add support for explicit locations inside interface blocks 2015-12-15 13:10:44 +11:00
ast_array_index.cpp glsl: Use array deref for access to vector components 2015-11-10 12:02:46 -08:00
ast_expr.cpp
ast_function.cpp glsl: Allow atomic functions to be used with shared variables 2015-12-09 23:50:38 -08:00
ast_to_hir.cpp glsl: tidy up struct with a single member 2015-12-30 11:52:05 +11:00
ast_type.cpp glsl: Pass ast_type_qualifier by const reference. 2015-11-24 10:05:33 -08:00
blob.c glsl: Add blob_overwrite_bytes and blob_overwrite_uint32 2015-01-16 13:47:40 -08:00
blob.h glsl: Add blob_overwrite_bytes and blob_overwrite_uint32 2015-01-16 13:47:40 -08:00
builtin_functions.cpp glsl: Implement all(v) as all_equal(v, true). 2015-12-18 13:20:13 -05:00
builtin_types.cpp glsl: move builtin vector types to glsl_types.cpp 2015-10-16 19:33:37 -04:00
builtin_variables.cpp mesa: Add core mesa support for GL_ARB_shader_draw_parameters 2015-12-29 10:39:25 -08:00
glsl_lexer.ll glsl: Parse shared keyword for compute shader variables 2015-11-09 17:21:12 -08:00
glsl_parser.yy glsl: add support for explicit locations inside interface blocks 2015-12-15 13:10:44 +11:00
glsl_parser_extras.cpp mesa: Add core mesa support for GL_ARB_shader_draw_parameters 2015-12-29 10:39:25 -08:00
glsl_parser_extras.h mesa: Add core mesa support for GL_ARB_shader_draw_parameters 2015-12-29 10:39:25 -08:00
glsl_symbol_table.cpp glsl: Add API to put default precision qualifiers in the symbol table 2015-11-12 09:50:13 +02:00
glsl_symbol_table.h glsl: Add API to put default precision qualifiers in the symbol table 2015-11-12 09:50:13 +02:00
hir_field_selection.cpp glsl: Use has_420pack(). 2015-12-08 15:36:57 -08:00
ir.cpp glsl: tidy up struct with a single member 2015-12-30 11:52:05 +11:00
ir.h glsl: tidy up struct with a single member 2015-12-30 11:52:05 +11:00
ir_basic_block.cpp glsl: Use typed foreach_in_list instead of foreach_list. 2014-07-01 08:55:51 -07:00
ir_basic_block.h
ir_builder.cpp glsl: provide the option of using BFE for unpack builting lowering 2015-08-28 18:28:04 -04:00
ir_builder.h glsl: provide the option of using BFE for unpack builting lowering 2015-08-28 18:28:04 -04:00
ir_clone.cpp glsl: add subroutine index qualifier support 2015-11-21 07:30:12 +11:00
ir_constant_expression.cpp glsl: Remove ir_unop_any. 2015-12-18 13:20:12 -05:00
ir_equals.cpp glsl: Add ir_samples_identical opcode 2015-11-19 20:17:16 -08:00
ir_expression_flattening.cpp glsl: Use typed foreach_in_list instead of foreach_list. 2014-07-01 08:55:51 -07:00
ir_expression_flattening.h
ir_function.cpp glsl: Add ir_var_shader_storage 2015-07-14 07:04:03 +02:00
ir_function_can_inline.cpp glsl: fix stale comment 2015-01-23 00:23:51 -05:00
ir_function_detect_recursion.cpp glsl: Use typed foreach_in_list_safe instead of foreach_list_safe. 2014-07-01 08:55:51 -07:00
ir_function_inlining.h
ir_hierarchical_visitor.cpp glsl: Add ir node for barrier 2015-06-12 15:12:39 -07:00
ir_hierarchical_visitor.h glsl: Add ir node for barrier 2015-06-12 15:12:39 -07:00
ir_hv_accept.cpp glsl: Add ir_samples_identical opcode 2015-11-19 20:17:16 -08:00
ir_import_prototypes.cpp
ir_optimization.h glsl: Add lowering pass for shared variable references 2015-12-09 23:50:38 -08:00
ir_print_visitor.cpp glsl: Add ir_samples_identical opcode 2015-11-19 20:17:16 -08:00
ir_print_visitor.h glsl: Add ir node for barrier 2015-06-12 15:12:39 -07:00
ir_reader.cpp glsl: remove trailing spaces in various files 2015-11-25 08:09:17 +01:00
ir_reader.h
ir_rvalue_visitor.cpp glsl: Add ir_samples_identical opcode 2015-11-19 20:17:16 -08:00
ir_rvalue_visitor.h glsl: Make ir_rvalue_visitor visit ir_discard::condition. 2015-02-24 15:24:52 -08:00
ir_set_program_inouts.cpp glsl: fix partial marking for fp64 types. 2015-12-19 11:42:26 +10:00
ir_uniform.h glsl: add top level array size and stride to gl_uniform_storage 2015-10-14 09:32:58 +03:00
ir_validate.cpp glsl: Remove ir_unop_any. 2015-12-18 13:20:12 -05:00
ir_variable_refcount.cpp glsl: remove dead code in a single pass 2015-10-15 20:36:14 +11:00
ir_variable_refcount.h glsl: remove dead code in a single pass 2015-10-15 20:36:14 +11:00
ir_visitor.h glsl: Add ir node for barrier 2015-06-12 15:12:39 -07:00
link_atomics.cpp glsl: tidy up struct with a single member 2015-12-30 11:52:05 +11:00
link_functions.cpp glsl: Make ir_variable::max_ifc_array_access private 2014-09-30 13:34:42 -07:00
link_interface_blocks.cpp glsl: add support for explicit locations inside interface blocks 2015-12-15 13:10:44 +11:00
link_uniform_block_active_visitor.cpp glsl/linker: annotate static functions as such 2015-12-30 11:51:58 +11:00
link_uniform_block_active_visitor.h glsl: link uniform block arrays of arrays 2015-10-15 21:42:24 +11:00
link_uniform_blocks.cpp glsl/linker: annotate static functions as such 2015-12-30 11:51:58 +11:00
link_uniform_initializers.cpp mesa: rename UniformBlockStageIndex to InterfaceBlockStageIndex 2015-11-03 16:44:22 -08:00
link_uniforms.cpp glsl: set image access qualifiers for AoA 2015-10-31 08:37:08 +11:00
link_varyings.cpp glsl: don't change the varying type in validation code 2016-01-06 10:52:58 +11:00
link_varyings.h glsl: fix transform feedback for 64-bit outupts. 2015-12-19 11:42:26 +10:00
linker.cpp glsl: only add outward facing varyings to resourse list for SSO 2016-01-06 10:52:48 +11:00
linker.h glsl: a shader storage buffer must be smaller than the maximum size allowed 2015-09-25 08:39:22 +02:00
list.h glsl: Rename safe_reverse -> reverse_safe. 2015-12-01 14:48:55 -08:00
loop_analysis.cpp glsl: Use typed foreach_in_list_safe instead of foreach_list_safe. 2014-07-01 08:55:51 -07:00
loop_analysis.h glsl: make consistent use of DECLARE_RALLOC_CXX_OPERATORS 2014-10-02 00:59:35 -04:00
loop_controls.cpp glsl: fix unreachable(!"") to unreachable("") 2015-03-30 08:16:00 +03:00
loop_unroll.cpp glsl: Add ir_var_shader_storage 2015-07-14 07:04:03 +02:00
lower_buffer_access.cpp glsl: Don't assert on shared variable matrices with 'inherited' layout 2015-12-09 23:50:38 -08:00
lower_buffer_access.h glsl ubo/ssbo: Move common code into lower_buffer_access::setup_buffer_access 2015-12-09 23:50:38 -08:00
lower_clip_distance.cpp glsl: make lower_clip_distance work with tessellation shaders. 2015-07-23 00:59:27 +02:00
lower_const_arrays_to_uniforms.cpp glsl: fix names in lower_constant_arrays_to_uniforms 2015-03-23 11:18:39 +02:00
lower_discard.cpp glsl: Use typed foreach_in_list instead of foreach_list. 2014-07-01 08:55:51 -07:00
lower_discard_flow.cpp glsl: Handle conditional discards in lower_discard_flow(). 2015-02-24 15:24:52 -08:00
lower_if_to_cond_assign.cpp glsl: Use typed foreach_in_list_safe instead of foreach_list_safe. 2014-07-01 08:55:51 -07:00
lower_instructions.cpp glsl: #include c99_math.h instead of core.h 2015-02-26 08:38:38 -07:00
lower_jumps.cpp glsl: Use typed foreach_in_list instead of foreach_list. 2014-07-01 08:55:51 -07:00
lower_mat_op_to_vec.cpp glsl: Remove ir_unop_any. 2015-12-18 13:20:12 -05:00
lower_named_interface_blocks.cpp glsl: copy how_declared when lowering interface blocks 2015-12-01 12:45:07 +11:00
lower_noise.cpp
lower_offset_array.cpp glsl: Standardize names and fix typos 2014-10-24 23:14:04 -07:00
lower_output_reads.cpp glsl: pass shader stage to lower_output_reads and handle tess control 2015-07-23 00:59:28 +02:00
lower_packed_varyings.cpp glsl: do not loose always_active_io when packing varyings 2015-12-10 07:51:55 +02:00
lower_packing_builtins.cpp glsl: provide the option of using BFE for unpack builting lowering 2015-08-28 18:28:04 -04:00
lower_shared_reference.cpp glsl: Translate atomic intrinsic functions on shared variables 2015-12-09 23:50:38 -08:00
lower_subroutine.cpp glsl: add AoA support to subroutines 2015-10-21 14:56:57 +11:00
lower_tess_level.cpp glsl: lower gl_TessLevel* from float[n] to vecn. 2015-07-23 00:59:27 +02:00
lower_texture_projection.cpp glsl: Use ir_var_temporary for compiler generated temporaries 2014-09-30 13:34:43 -07:00
lower_ubo_reference.cpp glsl: Check for SSBO variable in check_for_ssbo_store 2015-12-09 23:50:38 -08:00
lower_variable_index_to_cond_assign.cpp glsl: Don't lower_variable_index_to_cond_assign for shared variables 2015-12-09 23:50:38 -08:00
lower_vec_index_to_cond_assign.cpp glsl: Support uint index in do_vec_index_to_cond_assign 2015-10-14 13:16:34 -07:00
lower_vec_index_to_swizzle.cpp glsl: Use typed foreach_in_list_safe instead of foreach_list_safe. 2014-07-01 08:55:51 -07:00
lower_vector.cpp
lower_vector_derefs.cpp glsl: Use array deref for access to vector components 2015-11-10 12:02:46 -08:00
lower_vector_insert.cpp glsl: Support uint index in lower_vector_insert 2015-10-14 13:16:35 -07:00
lower_vertex_id.cpp glsl: Move link_get_main_function_signature to a common location 2015-09-13 09:53:16 -07:00
main.cpp glsl: make stand-alone compiler work with tessellation shaders. 2015-07-23 00:59:27 +02:00
opt_algebraic.cpp glsl: Make sure not to dereference NULL 2015-07-06 11:52:37 -07:00
opt_array_splitting.cpp glsl: handle case where index is array deref in optimize_split_arrays 2015-11-25 11:25:57 +02:00
opt_conditional_discard.cpp glsl: Optimize "if (cond) discard;" to a conditional discard. 2015-02-24 15:24:53 -08:00
opt_constant_folding.cpp glsl: Delete dead discard conditions in constant folding. 2015-02-24 15:24:52 -08:00
opt_constant_propagation.cpp glsl: Disable several optimizations on shared variables 2015-12-09 23:50:38 -08:00
opt_constant_variable.cpp glsl: Disable several optimizations on shared variables 2015-12-09 23:50:38 -08:00
opt_copy_propagation.cpp glsl: Disable several optimizations on shared variables 2015-12-09 23:50:38 -08:00
opt_copy_propagation_elements.cpp glsl: Reduce memory consumption of copy propagation passes. 2015-02-17 17:33:27 -08:00
opt_dead_builtin_variables.cpp glsl/cs: Exclude gl_LocalInvocationIndex from builtin variable stripping 2015-09-13 09:53:16 -07:00
opt_dead_builtin_varyings.cpp glsl/dead_builin_varyings: Fix gl_FragData array lowering 2015-12-01 08:30:52 +01:00
opt_dead_code.cpp glsl: don't dead code remove SSO varyings marked as active 2015-12-01 12:46:32 +11:00
opt_dead_code_local.cpp glsl: Use array deref for access to vector components 2015-11-10 12:02:46 -08:00
opt_dead_functions.cpp glsl: Use typed foreach_in_list_safe instead of foreach_list_safe. 2014-07-01 08:55:51 -07:00
opt_flatten_nested_if_blocks.cpp
opt_flip_matrices.cpp glsl: Use typed foreach_in_list instead of foreach_list. 2014-07-01 08:55:51 -07:00
opt_function_inlining.cpp Fix a few typos 2015-04-27 17:28:29 +03:00
opt_if_simplification.cpp
opt_minmax.cpp glsl: Add support doubles in optimization passes 2015-02-19 00:28:34 -05:00
opt_noop_swizzle.cpp
opt_rebalance_tree.cpp glsl: Make the tree rebalancer use vector_elements, not components(). 2014-07-16 15:43:13 -07:00
opt_redundant_jumps.cpp
opt_structure_splitting.cpp glsl: Add ir_var_shader_storage 2015-07-14 07:04:03 +02:00
opt_swizzle_swizzle.cpp
opt_tree_grafting.cpp glsl: Add ir_samples_identical opcode 2015-11-19 20:17:16 -08:00
opt_vectorize.cpp glsl: Fixed vectorize pass vs. texture lookups. 2014-08-14 09:40:33 -07:00
program.h glsl: Silence unused parameter warnings 2015-09-09 19:15:15 -07:00
s_expression.cpp glsl: Use INFINITY instead of std::numeric_limits<float>::infinity(). 2015-03-25 15:06:48 -07:00
s_expression.h glsl: replace Elements() with ARRAY_SIZE() 2015-03-02 08:55:30 -07:00
standalone_scaffolding.cpp mesa: Add core mesa support for GL_ARB_shader_draw_parameters 2015-12-29 10:39:25 -08:00
standalone_scaffolding.h mesa: remove len argument from _mesa_shader_debug() 2015-11-29 14:41:40 +00:00
test.cpp
test_optpass.cpp glsl: don't lower variable indexing on non-patch tessellation inputs/outputs 2015-07-23 00:59:27 +02:00
test_optpass.h

README

Welcome to Mesa's GLSL compiler.  A brief overview of how things flow:

1) lex and yacc-based preprocessor takes the incoming shader string
and produces a new string containing the preprocessed shader.  This
takes care of things like #if, #ifdef, #define, and preprocessor macro
invocations.  Note that #version, #extension, and some others are
passed straight through.  See glcpp/*

2) lex and yacc-based parser takes the preprocessed string and
generates the AST (abstract syntax tree).  Almost no checking is
performed in this stage.  See glsl_lexer.ll and glsl_parser.yy.

3) The AST is converted to "HIR".  This is the intermediate
representation of the compiler.  Constructors are generated, function
calls are resolved to particular function signatures, and all the
semantic checking is performed.  See ast_*.cpp for the conversion, and
ir.h for the IR structures.

4) The driver (Mesa, or main.cpp for the standalone binary) performs
optimizations.  These include copy propagation, dead code elimination,
constant folding, and others.  Generally the driver will call
optimizations in a loop, as each may open up opportunities for other
optimizations to do additional work.  See most files called ir_*.cpp

5) linking is performed.  This does checking to ensure that the
outputs of the vertex shader match the inputs of the fragment shader,
and assigns locations to uniforms, attributes, and varyings.  See
linker.cpp.

6) The driver may perform additional optimization at this point, as
for example dead code elimination previously couldn't remove functions
or global variable usage when we didn't know what other code would be
linked in.

7) The driver performs code generation out of the IR, taking a linked
shader program and producing a compiled program for each stage.  See
../mesa/program/ir_to_mesa.cpp for Mesa IR code generation.

FAQ:

Q: What is HIR versus IR versus LIR?

A: The idea behind the naming was that ast_to_hir would produce a
high-level IR ("HIR"), with things like matrix operations, structure
assignments, etc., present.  A series of lowering passes would occur
that do things like break matrix multiplication into a series of dot
products/MADs, make structure assignment be a series of assignment of
components, flatten if statements into conditional moves, and such,
producing a low level IR ("LIR").

However, it now appears that each driver will have different
requirements from a LIR.  A 915-generation chipset wants all functions
inlined, all loops unrolled, all ifs flattened, no variable array
accesses, and matrix multiplication broken down.  The Mesa IR backend
for swrast would like matrices and structure assignment broken down,
but it can support function calls and dynamic branching.  A 965 vertex
shader IR backend could potentially even handle some matrix operations
without breaking them down, but the 965 fragment shader IR backend
would want to break to have (almost) all operations down channel-wise
and perform optimization on that.  As a result, there's no single
low-level IR that will make everyone happy.  So that usage has fallen
out of favor, and each driver will perform a series of lowering passes
to take the HIR down to whatever restrictions it wants to impose
before doing codegen.

Q: How is the IR structured?

A: The best way to get started seeing it would be to run the
standalone compiler against a shader:

./glsl_compiler --dump-lir \
	~/src/piglit/tests/shaders/glsl-orangebook-ch06-bump.frag

So for example one of the ir_instructions in main() contains:

(assign (constant bool (1)) (var_ref litColor)  (expression vec3 * (var_ref Surf
aceColor) (var_ref __retval) ) )

Or more visually:
                     (assign)
                 /       |        \
        (var_ref)  (expression *)  (constant bool 1)
         /          /           \
(litColor)      (var_ref)    (var_ref)
                  /                  \
           (SurfaceColor)          (__retval)

which came from:

litColor = SurfaceColor * max(dot(normDelta, LightDir), 0.0);

(the max call is not represented in this expression tree, as it was a
function call that got inlined but not brought into this expression
tree)

Each of those nodes is a subclass of ir_instruction.  A particular
ir_instruction instance may only appear once in the whole IR tree with
the exception of ir_variables, which appear once as variable
declarations:

(declare () vec3 normDelta)

and multiple times as the targets of variable dereferences:
...
(assign (constant bool (1)) (var_ref __retval) (expression float dot
 (var_ref normDelta) (var_ref LightDir) ) )
...
(assign (constant bool (1)) (var_ref __retval) (expression vec3 -
 (var_ref LightDir) (expression vec3 * (constant float (2.000000))
 (expression vec3 * (expression float dot (var_ref normDelta) (var_ref
 LightDir) ) (var_ref normDelta) ) ) ) )
...

Each node has a type.  Expressions may involve several different types:
(declare (uniform ) mat4 gl_ModelViewMatrix)
((assign (constant bool (1)) (var_ref constructor_tmp) (expression
 vec4 * (var_ref gl_ModelViewMatrix) (var_ref gl_Vertex) ) )

An expression tree can be arbitrarily deep, and the compiler tries to
keep them structured like that so that things like algebraic
optimizations ((color * 1.0 == color) and ((mat1 * mat2) * vec == mat1
* (mat2 * vec))) or recognizing operation patterns for code generation
(vec1 * vec2 + vec3 == mad(vec1, vec2, vec3)) are easier.  This comes
at the expense of additional trickery in implementing some
optimizations like CSE where one must navigate an expression tree.

Q: Why no SSA representation?

A: Converting an IR tree to SSA form makes dead code elimination,
common subexpression elimination, and many other optimizations much
easier.  However, in our primarily vector-based language, there's some
major questions as to how it would work.  Do we do SSA on the scalar
or vector level?  If we do it at the vector level, we're going to end
up with many different versions of the variable when encountering code
like:

(assign (constant bool (1)) (swiz x (var_ref __retval) ) (var_ref a) )
(assign (constant bool (1)) (swiz y (var_ref __retval) ) (var_ref b) )
(assign (constant bool (1)) (swiz z (var_ref __retval) ) (var_ref c) )

If every masked update of a component relies on the previous value of
the variable, then we're probably going to be quite limited in our
dead code elimination wins, and recognizing common expressions may
just not happen.  On the other hand, if we operate channel-wise, then
we'll be prone to optimizing the operation on one of the channels at
the expense of making its instruction flow different from the other
channels, and a vector-based GPU would end up with worse code than if
we didn't optimize operations on that channel!

Once again, it appears that our optimization requirements are driven
significantly by the target architecture.  For now, targeting the Mesa
IR backend, SSA does not appear to be that important to producing
excellent code, but we do expect to do some SSA-based optimizations
for the 965 fragment shader backend when that is developed.

Q: How should I expand instructions that take multiple backend instructions?

Sometimes you'll have to do the expansion in your code generation --
see, for example, ir_to_mesa.cpp's handling of ir_unop_sqrt.  However,
in many cases you'll want to do a pass over the IR to convert
non-native instructions to a series of native instructions.  For
example, for the Mesa backend we have ir_div_to_mul_rcp.cpp because
Mesa IR (and many hardware backends) only have a reciprocal
instruction, not a divide.  Implementing non-native instructions this
way gives the chance for constant folding to occur, so (a / 2.0)
becomes (a * 0.5) after codegen instead of (a * (1.0 / 2.0))

Q: How shoud I handle my special hardware instructions with respect to IR?

Our current theory is that if multiple targets have an instruction for
some operation, then we should probably be able to represent that in
the IR.  Generally this is in the form of an ir_{bin,un}op expression
type.  For example, we initially implemented fract() using (a -
floor(a)), but both 945 and 965 have instructions to give that result,
and it would also simplify the implementation of mod(), so
ir_unop_fract was added.  The following areas need updating to add a
new expression type:

ir.h (new enum)
ir.cpp:operator_strs (used for ir_reader)
ir_constant_expression.cpp (you probably want to be able to constant fold)
ir_validate.cpp (check users have the right types)

You may also need to update the backends if they will see the new expr type:

../mesa/program/ir_to_mesa.cpp

You can then use the new expression from builtins (if all backends
would rather see it), or scan the IR and convert to use your new
expression type (see ir_mod_to_floor, for example).

Q: How is memory management handled in the compiler?

The hierarchical memory allocator "talloc" developed for the Samba
project is used, so that things like optimization passes don't have to
worry about their garbage collection so much.  It has a few nice
features, including low performance overhead and good debugging
support that's trivially available.

Generally, each stage of the compile creates a talloc context and
allocates its memory out of that or children of it.  At the end of the
stage, the pieces still live are stolen to a new context and the old
one freed, or the whole context is kept for use by the next stage.

For IR transformations, a temporary context is used, then at the end
of all transformations, reparent_ir reparents all live nodes under the
shader's IR list, and the old context full of dead nodes is freed.
When developing a single IR transformation pass, this means that you
want to allocate instruction nodes out of the temporary context, so if
it becomes dead it doesn't live on as the child of a live node.  At
the moment, optimization passes aren't passed that temporary context,
so they find it by calling talloc_parent() on a nearby IR node.  The
talloc_parent() call is expensive, so many passes will cache the
result of the first talloc_parent().  Cleaning up all the optimization
passes to take a context argument and not call talloc_parent() is left
as an exercise.

Q: What is the file naming convention in this directory?

Initially, there really wasn't one.  We have since adopted one:

 - Files that implement code lowering passes should be named lower_*
   (e.g., lower_noise.cpp).
 - Files that implement optimization passes should be named opt_*.
 - Files that implement a class that is used throught the code should
   take the name of that class (e.g., ir_hierarchical_visitor.cpp).
 - Files that contain code not fitting in one of the previous
   categories should have a sensible name (e.g., glsl_parser.yy).