nir/spirv/cfg: Detect switch_break after loop_break/continue
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 17 Sep 2016 05:04:57 +0000 (22:04 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 1 Oct 2016 22:40:34 +0000 (15:40 -0700)
commitef3c5ac7fb915f489a553fa9d9a0c96d219545ad
treedfc488432c16263dfe38e532aa3730a6664a3617
parent4d02faede57b782264ab97d57919e9dad7dd8131
nir/spirv/cfg: Detect switch_break after loop_break/continue

While the current CFG code is valid in the case where a switch break also
happens to be a loop continue, it's a bit suboptimal.  Since hardware is
capable of handling the continue as a direct jump, it's better to use a
continue instruction when we can than to bother with all of the nasty
switch break lowering.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/compiler/spirv/vtn_cfg.c