nir/loop_analyze: Track induction variables incremented by more operations
authorYevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Fri, 17 Jan 2020 11:01:01 +0000 (13:01 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 6 Apr 2023 23:50:27 +0000 (23:50 +0000)
commitf051967f19ef1f8c27565323adf14bf1f5284df9
tree00dffe1703a507c13b60e88c3f90174acaa651ab
parentbc170e895f384acf24c849798fcff092db440135
nir/loop_analyze: Track induction variables incremented by more operations

These operations are covered:

 - imul
 - fmul
 - ishl
 - ishr
 - ushr

The only cases that can be currently affected are those where the
calculated loop-trip count would be zero.

v2 (idr): Split out from original commit. Rebase on lots of other work.

v3 (idr): Move operand size assertion. This code only cares that the
operands have the same size for the iadd and fadd cases. In other
cases, such as shifts, the sizes may not match. Fixes assertion
failures in
tests/spec/arb_gpu_shader_int64/glsl-fs-loop-unroll-ishl-int64.shader_test.

No shader-db or fossil-db changes on any Intel platform.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
src/compiler/nir/nir_loop_analyze.c
src/compiler/nir/tests/loop_analyze_tests.cpp