glsl: Remove bonus tree walking in opt_constant_folding().
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 29 Apr 2016 21:04:17 +0000 (14:04 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 16 May 2016 06:59:10 +0000 (23:59 -0700)
It looks like this was missed when converting opt_constant_folding()
from a hierarchical visitor to an rvalue visitor in 6606fde3.

ir_rvalue_visitor already processes values on the way back up the tree,
so we will have already visited every child node.  There's no point in
doing it again.

No change in shader-db.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/glsl/opt_constant_folding.cpp

index 150a17b2af68f8882d83eba99b7e3fd96217035d..de13c9e068ec67b7eb5307918583a8dcd7740d84 100644 (file)
@@ -89,8 +89,6 @@ ir_constant_folding_visitor::handle_rvalue(ir_rvalue **rvalue)
    if (constant) {
       *rvalue = constant;
       this->progress = true;
-   } else {
-      (*rvalue)->accept(this);
    }
 }