[Mesa-dev] [PATCH 21/30] i965/fs: Add live interval validation pass.
Matt Turner
mattst88 at gmail.com
Mon Mar 14 04:38:40 UTC 2016
On Sun, Mar 13, 2016 at 8:47 PM, Francisco Jerez <currojerez at riseup.net> wrote:
> This could be improved somewhat with additional validation of the
> calculated live in/out sets and by checking that the calculated live
> intervals are minimal (which isn't strictly necessary to guarantee the
> correctness of the program). This should be good enough though to
> catch accidental use of stale liveness results due to missing or
> incorrect analysis invalidation.
> ---
> .../drivers/dri/i965/brw_fs_live_variables.cpp | 41 ++++++++++++++++++++++
> src/mesa/drivers/dri/i965/brw_fs_live_variables.h | 3 ++
> 2 files changed, 44 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
> index 4b0943f..215349a 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
> @@ -304,6 +304,47 @@ fs_live_variables::~fs_live_variables()
> ralloc_free(mem_ctx);
> }
>
> +static bool
> +check_register_live_range(const fs_live_variables *live, int ip,
> + const fs_reg ®, unsigned n)
> +{
> + const unsigned var = live->var_from_reg(reg);
> +
> + if (var + n > unsigned(live->num_vars) ||
> + live->vgrf_start[reg.nr] > ip || live->vgrf_end[reg.nr] < ip)
> + return false;
> +
> + for (unsigned j = 0; j < n; j++) {
> + if (live->start[var + j] > ip || live->end[var + j] < ip)
> + return false;
Braces in nested control flow. Elsewhere in this patch as well, and
also in the next patch.
More information about the mesa-dev
mailing list