Skip to content
Snippets Groups Projects
Commit 6e22ad6e authored by Timothy Arceri's avatar Timothy Arceri
Browse files

nir: return early when lowering a return at the end of a function


Otherwise we create unused conditional return flags and things
get unnecessarily ugly fast when lowering nested functions.

Reviewed-by: default avatarJason Ekstrand <jason@jlekstrand.net>
parent d3cafc18
No related branches found
No related tags found
No related merge requests found
......@@ -180,6 +180,12 @@ lower_returns_in_block(nir_block *block, struct lower_returns_state *state)
nir_instr_remove(&jump->instr);
/* If this is a return in the last block of the function there is nothing
* more to do once its removed.
*/
if (block == nir_impl_last_block(state->builder.impl))
return true;
nir_builder *b = &state->builder;
/* Set the return flag */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment