Fix register allocator with STORE_LOCAL. May indicate redundant stores.

This commit is contained in:
Ben Vanik 2014-08-05 11:48:45 -07:00
parent 2854841753
commit 810c256f21
1 changed files with 5 additions and 3 deletions

View File

@ -112,9 +112,11 @@ int RegisterAllocationPass::Run(HIRBuilder* builder) {
if (!instr->src1_use->next) {
// Pull off preferred register. We will try to reuse this for the
// dest.
// NOTE: set may be null if this is a store local.
if (preferred_reg.set) {
has_preferred_reg = true;
preferred_reg = instr->src1.value->reg;
assert_not_null(preferred_reg.set);
}
}
}