nir/loop_analyze: delay instruction cost calculation
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 14 Sep 2022 00:18:05 +0000 (10:18 +1000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 27 Sep 2022 00:31:47 +0000 (00:31 +0000)
commit13d0ae593be02cf9b3ed77eea9abeeb7181dd0e5
treed36e2249787192bd3d3d37cff3612ee5e8e5cf6e
parent8b9a5adf8be6ed813037659d72d21611075f5d43
nir/loop_analyze: delay instruction cost calculation

Here we move the calculation of the instruction cost of the loop
after we have processed other information such as finding the
induction variables. This is useful because we can use this further
information to find instructions that will be eliminated if the
loop was to unroll and therefore give them a cost of 0.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18587>
src/compiler/nir/nir_loop_analyze.c