[Mesa-dev] [PATCH 0/7] NIR dead control flow, take two

Kenneth Graunke kenneth at whitecape.org
Tue Sep 1 01:55:12 PDT 2015


On Tuesday, July 21, 2015 09:53:25 PM Connor Abbott wrote:
> This is another spin of my dead control flow elimination series, this
> time based on the control flow modification series I sent out earlier.
> It's much shorter, since it now uses the much-more-reusable modification
> API, rather than a few ad-hoc functions to do what it needs to do. The
> changes themselves were relatively minor, however.
> 
> Like before, the last patch is for testing purposes only; it lobotomizes
> the GLSL IR pass that does roughly the equivalent thing, so that the NIR
> version gets more exposure. It causes one extra piglit failure, but
> that's expected and not due to the NIR pass. The constant folding test
> expects the compiler to optimize away a function call before link time,
> but after disabling the optimization, that no longer happens. Jenkins
> reports that piglit.spec.arb_shader_atomic_counters.semantics also
> fails, but only on one platform and I couldn't reproduce it so it seems
> like a spurious failure. Other than that, there are no piglit
> regressions.
> 
> Connor Abbott (7):
>   nir: add an optimization for removing dead control flow
>   nir/dead_cf: delete code that's unreachable due to jumps
>   nir: add nir_block_get_following_loop() helper
>   nir: add a helper for iterating over blocks in a cf node
>   nir/dead_cf: add support for removing useless loops
>   i965/fs/nir: enable the dead control flow optimization
>   XXX disable opt_if_simplification
> 
>  src/glsl/Makefile.sources           |   1 +
>  src/glsl/glsl_parser_extras.cpp     |   2 +-
>  src/glsl/nir/nir.c                  |  23 +++
>  src/glsl/nir/nir.h                  |   6 +
>  src/glsl/nir/nir_opt_dead_cf.c      | 359 ++++++++++++++++++++++++++++++++++++
>  src/mesa/drivers/dri/i965/brw_nir.c |   2 +
>  6 files changed, 392 insertions(+), 1 deletion(-)
>  create mode 100644 src/glsl/nir/nir_opt_dead_cf.c
> 
> 

Series (other than the XXX patch) is:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

I've also gone ahead and pushed it to master.

My only concern was that I think we could do this more cleanly...but I
haven't come up with anything better.  It appears correct, and does
really useful things.  So, landed.  Thanks for writing this!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150901/86662dee/attachment.sig>


More information about the mesa-dev mailing list