only add site to result if result is live in CombineEvent::compile and TranslateEvent::compile

This commit is contained in:
Joel Dice 2009-02-28 19:08:14 -07:00
parent 5adcfa3341
commit 93ebb571b3

View File

@ -2766,24 +2766,24 @@ maybePreserve(Context* c, Value* v, Site* s)
Site* Site*
getTarget(Context* c, Value* value, Value* result, const SiteMask& resultMask) getTarget(Context* c, Value* value, Value* result, const SiteMask& resultMask)
{ {
Site* s;
Value* v;
if (c->arch->condensedAddressing()) { if (c->arch->condensedAddressing()) {
Site* s = value->source; s = value->source;
v = value;
maybePreserve(c, value, s); maybePreserve(c, value, s);
removeSite(c, value, s);
s->freeze(c, value);
return s;
} else { } else {
SingleRead r(resultMask); SingleRead r(resultMask);
Site* s = pickTargetSite(c, &r); s = pickTargetSite(c, &r);
v = result;
addSite(c, result, s); addSite(c, result, s);
return s;
} }
removeSite(c, v, s);
s->freeze(c, v);
return s;
} }
Site* Site*
@ -2866,17 +2866,15 @@ class CombineEvent: public Event {
popRead(c, this, r->value); popRead(c, this, r->value);
} }
if (c->arch->condensedAddressing()) { low->thaw(c, second);
low->thaw(c, second); if (resultSize > BytesPerWord) {
if (resultSize > BytesPerWord) { high->thaw(c, second->high);
high->thaw(c, second->high); }
}
if (live(result)) { if (live(result)) {
addSite(c, result, low); addSite(c, result, low);
if (resultSize > BytesPerWord and live(result->high)) { if (resultSize > BytesPerWord and live(result->high)) {
addSite(c, result->high, high); addSite(c, result->high, high);
}
} }
} }
} }
@ -3197,17 +3195,15 @@ class TranslateEvent: public Event {
popRead(c, this, r->value); popRead(c, this, r->value);
} }
if (c->arch->condensedAddressing()) { low->thaw(c, value);
low->thaw(c, value); if (size > BytesPerWord) {
if (size > BytesPerWord) { high->thaw(c, value->high);
high->thaw(c, value->high); }
}
if (live(result)) { if (live(result)) {
addSite(c, result, low); addSite(c, result, low);
if (size > BytesPerWord and live(result->high)) { if (size > BytesPerWord and live(result->high)) {
addSite(c, result->high, high); addSite(c, result->high, high);
}
} }
} }
} }