enabled by recent iropt hacking.
When looking for a real-reg to house a virtual reg, reg-alloc
looks around for (v,r) pairs in which v is already dead, and
so r can be re-used for a new virtual reg. However, it would
be too aggressive in this, and use v even if v went dead
immediately before the current insn, which means v could still
be read by the current insn. This change requires that v go
dead before the insn prior to this one, so that we are
guaranteed v is not used in this insn.
This commit message is way longer than the actual bug fix :-)
git-svn-id: svn://svn.valgrind.org/vex/trunk@180
&& hregClass(state[k].rreg) == hregClass(vreg)) {
m = hregNumber(state[k].vreg);
vassert(m >= 0 && m < n_vregs);
- if (vreg_info[m].dead_before <= ii) {
- /* Ok, it's gone dead before this insn. We can use
- it. */
+ if (vreg_info[m].dead_before < ii) {
+ /* Ok, it's gone dead before the previous insn. We
+ can use it. */
break;
}
}