freedreno/ir3: insert extra move into phi
authorRob Clark <robclark@freedesktop.org>
Tue, 5 Apr 2016 17:45:34 +0000 (13:45 -0400)
committerRob Clark <robclark@freedesktop.org>
Tue, 5 Apr 2016 19:04:43 +0000 (15:04 -0400)
commit506b561ba7e3df2a7759dded684fae84bf459f65
tree596606d61e975dfbf82e696fefd0936c7d12b6aa
parentf9cdbf44054009122fcc16c887fb90ccc33b52c9
freedreno/ir3: insert extra move into phi

We had an implicit assumption that the phi src was assigned in it's
source (pred) block leading into the phi.  But this is not true with
NIR, so we can't just ignore the source block specified in the
nir_phi_src.  Insert an extra mov in the source block.  If it is not
required the CP pass will take it back out again.

Fixes:

  ./tests/spec/glsl-1.10/execution/vs-call-in-nested-loop.shader_test
  ./tests/spec/glsl-1.10/execution/vs-inner-loop-modifies-outer-loop-var.shader_test

and probably others.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c