nir: only override previous alu during loop analysis if supported
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 19 Mar 2019 01:09:36 +0000 (12:09 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 21 Mar 2019 10:51:21 +0000 (21:51 +1100)
commit427a6fee439b2df96edc813c56572169385772a6
tree332698d3618c2e091f0a89f3f386639bce080b6f
parent6d0a7f798c7f3de5c35b5ab3f2006a50f49f79b5
nir: only override previous alu during loop analysis if supported

Users of this function expect alu to be a supported comparision
if the induction variable is not NULL. Since we attempt to
override the return values if the first limit is not a const, we
must make sure we are dealing with a valid comparision before
overriding the alu instruction.

Fixes an unreachable in inverse_comparison() with the game
Assasins Creed Odyssey.

Fixes: 3235a942c16b ("nir: find induction/limit vars in iand instructions")
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110216
src/compiler/nir/nir_loop_analyze.c