optimizer: fix coordinate shift when a letrec
is split
The combination of splitting a `letrec` and optimizing the resulting `(let ([x <proc>]) x)` to just `<proc>` used a bad coordinate shift, which made property testing incorrect, etc. For reasons that are not clear, the new expander triggered the problem through an existing test.
This commit is contained in:
parent
e65beb2636
commit
aaee824f68
|
@ -6372,7 +6372,7 @@ scheme_optimize_lets(Scheme_Object *form, Optimize_Info *info, int for_inline, i
|
|||
&& (((Scheme_Local *)clv->body)->position == 0)) {
|
||||
if (worth_lifting(clv->value)) {
|
||||
value = clv->value;
|
||||
extract_depth = 1;
|
||||
extract_depth = 1 + split_shift;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7500,7 +7500,7 @@ Scheme_Object *scheme_optimize_expr(Scheme_Object *expr, Optimize_Info *info, in
|
|||
|
||||
delta = optimize_info_get_shift(info, pos);
|
||||
|
||||
if (!optimize_is_mutated(info, pos + delta)) {
|
||||
if (!is_mutated) {
|
||||
Scheme_Object *pred;
|
||||
|
||||
pred = optimize_get_predicate(pos + delta, info);
|
||||
|
@ -8664,7 +8664,7 @@ Scheme_Object *optimize_get_predicate(int pos, Optimize_Info *info)
|
|||
pos -= info->new_frame;
|
||||
if (pos < 0)
|
||||
return NULL;
|
||||
info = info->next;
|
||||
info = info->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue
Block a user