st/glsl_to_tgsi: be precise about merging scopes

enclosing_scope already contains enclosing_scope_first_read.
What we really want to check here -- not for correctness, but
for speed -- is whether last_read_scope already contains
enclosing_scope.

Reviewed-By: Gert Wollny <gw.fossdev@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
This commit is contained in:
Nicolai Hähnle 2017-09-06 11:43:06 +02:00
parent cffc0ae0d9
commit 55ca12be9d
1 changed files with 2 additions and 2 deletions

View File

@ -540,8 +540,8 @@ lifetime temp_comp_access::get_required_lifetime()
if (enclosing_scope_first_write->contains_range_of(*enclosing_scope))
enclosing_scope = enclosing_scope_first_write;
if (enclosing_scope_first_read->contains_range_of(*enclosing_scope))
enclosing_scope = enclosing_scope_first_read;
if (last_read_scope->contains_range_of(*enclosing_scope))
enclosing_scope = last_read_scope;
while (!enclosing_scope->contains_range_of(*enclosing_scope_first_write) ||
!enclosing_scope->contains_range_of(*last_read_scope)) {