nir/inline_functions: Handle halting functions.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 26 Jul 2021 15:05:20 +0000 (17:05 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 13 Aug 2021 21:18:13 +0000 (21:18 +0000)
commitaa8179e33f8b1fce5dd0a1df3cc265cc3e3d9cbd
treec203a90a6842bcb6e0cbc530469602dbce80306d
parentfa6cd6e00daace43b70800edf2499a7d7a779aa8
nir/inline_functions: Handle halting functions.

Without this stitch_blocks complains about ending in a jump with a
non-empty block after the inserted body.

I hit this with CTS raytracing tests where we tried to inline a
function that basically ended up being something like

{
   ignore_ray_intersection
   halt
}

I kept the nop path when possible as that does not leave a mess
for the optimization loop to optimize.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12163>
src/compiler/nir/nir_inline_functions.c