OSDN Git Service

nir/vars_to_ssa: Rework copy set handling in lower_copies_to_load_store
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 13 Nov 2015 02:10:22 +0000 (18:10 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 13 Nov 2015 06:08:43 +0000 (22:08 -0800)
commit226ba889a0f820b9f4b1132e379620d2688c96e7
tree5eb5b34d5ad0423ae187ae236e9ae7fca54c55ea
parent4bbf2ac06e71102a65b4d0427a0ba630a3c2477c
nir/vars_to_ssa: Rework copy set handling in lower_copies_to_load_store

Previously, we walked through a given deref_node's copies and, after
lowering the copy away, removed it from both the source and destination
copy sets.  This commit changes this to only remove it from the other
node's copy set (not the one we're lowering).  At the end of the loop, we
just throw away the copy set for the node we're lowering since that node no
longer has any copies.  This has two advantages:

 1) It's more efficient because we're doing potentially half as many set
    search operations.

 2) It now properly handles copies from a node to itself.  Perviously, it
    would delete the copy from the set when processing the destinatioon and
    then assert-fail when we couldn't find it for the source.

Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92588
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir_lower_vars_to_ssa.c