[Mesa-dev] [PATCH 00/30] i965: IR analysis pass framework.

Francisco Jerez currojerez at riseup.net
Mon Mar 14 03:47:04 UTC 2016


The purpose of this series is to introduce some lightweight
infrastructure intended to make room for additional analysis passes in
the i965 back-end without increasing the clutter of the visitor
objects, to reduce duplication of logic between analysis passes, and
to prevent some mistakes that are fairly difficult to avoid under the
current (rather informal) approach.

Patches 1-3 of this series fix some long-standing bugs that were
uncovered by the additional validation done by the analysis pass
framework.  The bugs could be hit during either shader-db or piglit
runs.  All the three caused us to use inconsistent live interval
metadata in some cases and could potentially lead to program
miscompilation.  I don't know whether there are any real-life
workloads where it actually caused corruption, in doubt it seems
sensible to back-port them to stable branches.

Patches 5-10 is mostly trivial header file churn intended to
clean things up and prevent circular header dependencies in cases
where the header inclusion order was the opposite of their
logical dependency order.

Patches 11-13 is the core of this series.  They introduce the general
framework that will be put to use in the following patches.

Patch 14 instruments the whole back-end with analysis metadata
invalidation and might be one of the more difficult to review.  On the
bright side it's no longer a particularly critical thing to get right,
because any mistake in the invalidation instrumentation will
eventually trigger an assertion failure if it leads to a situation
where we attempt to use analysis metadata that has become inconsistent
with the program, as demonstrated in patches 1-3.

The rest of the series is mainly about converting existing
analysis passes to the new framework.  Patches 16-25 port the
VEC4 and FS liveness analysis passes, patches 26-27 port the
dominance analysis pass and patch 29 ports the register pressure
calculation in the FS back-end.

For a branch in testable form see:
 https://cgit.freedesktop.org/~currojerez/mesa/log/?h=i965-ir-analysis

Enjoy.

[PATCH 01/30] i965/fs: Add missing analysis invalidation in opt_sampler_eot().
[PATCH 02/30] i965/fs: Add missing analysis invalidation in fixup_3src_null_dest().
[PATCH 03/30] i965/vec4: Consider removal of no-op MOVs as progress during register coalesce.
[PATCH 04/30] i965/fs: Restrict inequality that can only hold equal in saturate propagation.
[PATCH 05/30] i965/ir: Move base IR definitions into a separate header file.
[PATCH 06/30] i965/ir: Reverse inclusion dependency between brw_cfg.h and brw_shader.h.
[PATCH 07/30] i965/ir: Nest definition of live variables block_data structures.
[PATCH 08/30] i965/ir: Add include guards to the live variables header files.
[PATCH 09/30] i965/fs: Reverse inclusion dependency between brw_fs_live_variables.h and brw_fs.h.
[PATCH 10/30] i965/vec4: Reverse inclusion dependency between brw_vec4_live_variables.h and brw_vec4.h.
[PATCH 11/30] i965/ir: Introduce simple IR analysis pass framework.
[PATCH 12/30] i965/ir: Introduce backend_shader method to propagate IR changes to analysis passes.
[PATCH 13/30] i965/ir: Define more detailed analysis dependency classes.
[PATCH 14/30] i965/ir: Pass detailed dependency classes to invalidate_analysis().
[PATCH 15/30] i965/ir: Mark virtual_grf_interferes and vars_interfere as const.
[PATCH 16/30] i965/fs: Move all live interval analysis results into fs_live_variables.
[PATCH 17/30] i965/vec4: Move all live interval analysis results into vec4_live_variables.
[PATCH 18/30] i965/vec4: Restructure live intervals computation code.
[PATCH 19/30] i965/fs: Pass single backend_shader argument to the fs_live_variables constructor.
[PATCH 20/30] i965/vec4: Pass single backend_shader argument to the vec4_live_variables constructor.
[PATCH 21/30] i965/fs: Add live interval validation pass.
[PATCH 22/30] i965/vec4: Add live interval validation pass.
[PATCH 23/30] i965/fs: Switch liveness analysis to IR analysis framework.
[PATCH 24/30] i965/vec4: Switch liveness analysis to IR analysis framework.
[PATCH 25/30] i965/ir: Drop invalidate_live_intervals().
[PATCH 26/30] i965/ir: Move idom tree calculation and related logic into analysis object.
[PATCH 27/30] i965/ir: Move dominance tree data structure into idom_tree object.
[PATCH 28/30] i965/ir: Simplify new_idom reduction in dominance tree calculation.
[PATCH 29/30] i965/fs: Move register pressure calculation into IR analysis object.
[PATCH 30/30] i965/fs: Calculate num_instructions in O(1) during register pressure calculation.


More information about the mesa-dev mailing list