mesa/src
Matt Turner 9aa4e400d2 nir: Walk blocks in source code order in lower_vars_to_ssa.
Prior to this commit rename_variables_block() is recursively called,
performing a depth-first traversal of the control flow graph. The
function uses a non-trivial amount of stack space for local variables,
which puts us in danger of smashing the stack, given a sufficiently deep
dominance tree.

XCOM: Enemy Within contains a shader with such a dominance tree (1574
nir_blocks in total, depth of at least 143).

Jason tells me that he believes that any walk over the nir_blocks that
respects dominance is sufficient (a DFS might have been necessary prior
to the introduction of nir_phi_builder).

In fact, the introduction of nir_phi_builder made the problem worse:
rename_variables_block(), walks to the bottom of the dominance tree
before calling nir_phi_builder_value_get_block_def() which walks back to
the top of the dominance tree...

In any case, this patch ensures we avoid that problem as well.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97225
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
(cherry picked from commit e53130cc27)
2016-09-01 11:39:46 +01:00
..
compiler nir: Walk blocks in source code order in lower_vars_to_ssa. 2016-09-01 11:39:46 +01:00
egl egl/wayland-egl: Fix for segfault in dri2_wl_destroy_surface. 2016-09-01 11:39:44 +01:00
gallium radeonsi: disable SDMA texture copying on Carrizo 2016-09-01 11:39:45 +01:00
gbm mesa: Use AC_HEADER_MAJOR to include correct header for major(). 2016-09-01 11:39:44 +01:00
getopt
glx glx: Don't use current context in __glXSendError 2016-09-01 11:39:42 +01:00
gtest
hgl
intel anv: Include the pipeline layout in the shader hash 2016-09-01 11:39:45 +01:00
loader mesa: Use AC_HEADER_MAJOR to include correct header for major(). 2016-09-01 11:39:44 +01:00
mapi mapi: Massage code to allow clang to compile. 2016-07-27 11:07:53 +01:00
mesa swrast: fix incorrectly positioned putImage() in swrast driver 2016-09-01 11:39:45 +01:00
util mesa: Add .gitignore entries for make check binaries 2016-05-25 09:41:44 -07:00
Makefile.am automake: don't mandate git_sha1.h/MESA_GIT_SHA1 2016-07-07 16:12:33 +01:00
SConscript glsl: move to compiler/ 2016-01-26 16:08:33 +00:00