r600g/sb: fix handling of interference sets in post_scheduler

post_scheduler clears interference set for reallocatable values when
the value becomes live first time, and then updates it to take into
account modified order of operations, but this was not handled properly
if the value appears first time as a source in copy operation.

Fixes issues with webgl demo: http://madebyevan.com/webgl-water/

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
This commit is contained in:
Vadim Girlin 2013-05-02 07:53:00 +04:00
parent e16ef1f454
commit c49b6d7f27
2 changed files with 8 additions and 8 deletions

View file

@ -874,7 +874,7 @@ void post_scheduler::update_local_interferences() {
}
}
void post_scheduler::update_live_src_vec(vvec &vv, val_set &born, bool src) {
void post_scheduler::update_live_src_vec(vvec &vv, val_set *born, bool src) {
for (vvec::iterator I = vv.begin(), E = vv.end(); I != E; ++I) {
value *v = *I;
@ -892,7 +892,8 @@ void post_scheduler::update_live_src_vec(vvec &vv, val_set &born, bool src) {
cleared_interf.add_val(v);
}
}
born.add_val(v);
if (born)
born->add_val(v);
}
} else if (v->is_rel()) {
if (!v->rel->is_any_gpr())
@ -924,7 +925,7 @@ void post_scheduler::update_live_dst_vec(vvec &vv) {
}
}
void post_scheduler::update_live(node *n, val_set &born) {
void post_scheduler::update_live(node *n, val_set *born) {
update_live_dst_vec(n->dst);
update_live_src_vec(n->src, born, true);
update_live_src_vec(n->dst, born, false);
@ -948,7 +949,7 @@ void post_scheduler::process_group() {
if (!n)
continue;
update_live(n, vals_born);
update_live(n, &vals_born);
}
PSC_DUMP(
@ -1550,8 +1551,7 @@ bool post_scheduler::check_copy(node *n) {
if (s->is_prealloc() && !map_src_val(s))
return true;
live.remove_val(d);
live.add_val(s);
update_live(n, NULL);
release_src_values(n);
n->remove();

View file

@ -297,9 +297,9 @@ public:
bool recolor_local(value *v);
void update_local_interferences();
void update_live_src_vec(vvec &vv, val_set &born, bool src);
void update_live_src_vec(vvec &vv, val_set *born, bool src);
void update_live_dst_vec(vvec &vv);
void update_live(node *n, val_set &born);
void update_live(node *n, val_set *born);
void process_group();
void set_color_local_val(value *v, sel_chan color);