aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/opt_copy_propagation_elements.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-14 06:41:54 +0000
committermarha <marha@users.sourceforge.net>2011-04-14 06:41:54 +0000
commit019fc27ce6dc2a1809107be10d4deb80e0fa436b (patch)
tree57bc2571720a5d6e518ef15879d56ea066df494c /mesalib/src/glsl/opt_copy_propagation_elements.cpp
parent7bcdd32ccff794b9a83a88ff9bc2d0b7b088bd06 (diff)
downloadvcxsrv-019fc27ce6dc2a1809107be10d4deb80e0fa436b.tar.gz
vcxsrv-019fc27ce6dc2a1809107be10d4deb80e0fa436b.tar.bz2
vcxsrv-019fc27ce6dc2a1809107be10d4deb80e0fa436b.zip
server xkeyboard-config mesa git update 14 Apr 2011
Diffstat (limited to 'mesalib/src/glsl/opt_copy_propagation_elements.cpp')
-rw-r--r--mesalib/src/glsl/opt_copy_propagation_elements.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/mesalib/src/glsl/opt_copy_propagation_elements.cpp b/mesalib/src/glsl/opt_copy_propagation_elements.cpp
index 8541d9a8e..a91e624cb 100644
--- a/mesalib/src/glsl/opt_copy_propagation_elements.cpp
+++ b/mesalib/src/glsl/opt_copy_propagation_elements.cpp
@@ -161,9 +161,16 @@ ir_visitor_status
ir_copy_propagation_elements_visitor::visit_leave(ir_assignment *ir)
{
ir_dereference_variable *lhs = ir->lhs->as_dereference_variable();
+ ir_variable *var = ir->lhs->variable_referenced();
+
+ if (var->type->is_scalar() || var->type->is_vector()) {
+ kill_entry *k;
+
+ if (lhs)
+ k = new(mem_ctx) kill_entry(var, ir->write_mask);
+ else
+ k = new(mem_ctx) kill_entry(var, ~0);
- if (lhs && (lhs->type->is_scalar() || lhs->type->is_vector())) {
- kill_entry *k = new(mem_ctx) kill_entry(lhs->var, ir->write_mask);
kill(k);
}
@@ -383,8 +390,10 @@ ir_copy_propagation_elements_visitor::kill(kill_entry *k)
if (entry->lhs == k->var) {
entry->write_mask = entry->write_mask & ~k->write_mask;
- if (entry->write_mask == 0)
+ if (entry->write_mask == 0) {
entry->remove();
+ continue;
+ }
}
if (entry->rhs == k->var) {
entry->remove();