[Mesa-dev] [PATCH v2] i965/nir: do int64 lowering before optimization
Matt Turner
mattst88 at gmail.com
Mon Feb 5 18:06:23 UTC 2018
On Mon, Feb 5, 2018 at 5:40 AM, Iago Toral Quiroga <itoral at igalia.com> wrote:
> Otherwise loop unrolling will fail to see the actual cost of
> the unrolling operations when the loop body contains 64-bit integer
> instructions, and very specially when the divmod64 lowering applies,
> since its lowering is quite expensive.
>
> Without this change, some in-development CTS tests for int64
> get stuck forever trying to register allocate a shader with
> over 50K SSA values. The large number of SSA values is the result
> of NIR first unrolling multiple seemingly simple loops that involve
> int64 instructions, only to then lower these instructions to produce
> a massive pile of code (due to the divmod64 lowering in the unrolled
> instructions).
>
> With this change, loop unrolling will see the loops with the int64
> code already lowered and will realize that it is too expensive to
> unroll.
>
> v2: Run nir_algebraic first so we can hopefully get rid of some of
> the int64 instructions before we even attempt to lower them.
> ---
>
> For reference, I captured execution times for the CTS tests that
> raised the problem. This is with debug builds of Mesa and CTS so
> they are not ideal, but I think they are sufficient to see the
> imapact of the patch.
>
> With this patch: 52s
> With this v1: 56s
> With master: 1m:38s (*)
>
> (*) This is actually a significant improvement that has happened in
> master since we sent the original patch. Originally, the tests would
> just hang forever trying to compile.
Seems like a step in the right direction.
Reviewed-by: Matt Turner <mattst88 at gmail.com>
More information about the mesa-dev
mailing list