mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-26 13:10:22 +02:00
Correct the reason the simplify_stxi bug was not noticed before
* lib/lightning.c: Correct the reason the bug in simplify_stxi was not triggered before, it was due to incorrectly resetting the value->code field, what was causing it to never properly optimize: stxi Im0 Rb0 Rt0 ldxi Rt1 Rb1 Im1 when Rb0 == Rb1, Rt0 == Rt1 and Im0 == Im1 There was another possible issue, that has been also addressed in this commit, that would be the case of Rbn == Rtn, where no redundancy removal is possible.
This commit is contained in:
parent
5724068b1c
commit
f6970c62cf
2 changed files with 17 additions and 3 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
2015-02-03 Paulo Andrade <pcpa@gnu.org>
|
||||||
|
|
||||||
|
* lib/lightning.c: Correct the reason the bug in
|
||||||
|
simplify_stxi was not triggered before, it was due to
|
||||||
|
incorrectly resetting the value->code field, what was
|
||||||
|
causing it to never properly optimize:
|
||||||
|
stxi Im0 Rb0 Rt0
|
||||||
|
ldxi Rt1 Rb1 Im1
|
||||||
|
when Rb0 == Rb1, Rt0 == Rt1 and Im0 == Im1
|
||||||
|
There was another possible issue, that has been also
|
||||||
|
addressed in this commit, that would be the case of
|
||||||
|
Rbn == Rtn, where no redundancy removal is possible.
|
||||||
|
|
||||||
2015-02-03 Paulo Andrade <pcpa@gnu.org>
|
2015-02-03 Paulo Andrade <pcpa@gnu.org>
|
||||||
|
|
||||||
* lib/lightning.c: Correct wrong check in simplify_stxi.
|
* lib/lightning.c: Correct wrong check in simplify_stxi.
|
||||||
|
|
|
@ -2759,7 +2759,8 @@ _simplify_ldxi(jit_state_t *_jit, jit_node_t *prev, jit_node_t *node)
|
||||||
regno = jit_regno(node->u.w);
|
regno = jit_regno(node->u.w);
|
||||||
right = jit_regno(node->v.w);
|
right = jit_regno(node->v.w);
|
||||||
value = _jitc->values + regno;
|
value = _jitc->values + regno;
|
||||||
if (value->kind == jit_kind_code && value->code == node->code &&
|
if (regno != right &&
|
||||||
|
value->kind == jit_kind_code && value->code == node->code &&
|
||||||
value->base.q.l == right && value->base.q.h == _jitc->gen[right] &&
|
value->base.q.l == right && value->base.q.h == _jitc->gen[right] &&
|
||||||
node->w.w == value->disp.w) {
|
node->w.w == value->disp.w) {
|
||||||
del_node(prev, node);
|
del_node(prev, node);
|
||||||
|
@ -2788,7 +2789,8 @@ _simplify_stxi(jit_state_t *_jit, jit_node_t *prev, jit_node_t *node)
|
||||||
value = _jitc->values + regno;
|
value = _jitc->values + regno;
|
||||||
|
|
||||||
/* check for redundant store after load */
|
/* check for redundant store after load */
|
||||||
if (value->kind == jit_kind_code && value->code == node->code &&
|
if (regno != right &&
|
||||||
|
value->kind == jit_kind_code && value->code == node->code &&
|
||||||
value->base.q.l == right && value->base.q.h == _jitc->gen[right] &&
|
value->base.q.l == right && value->base.q.h == _jitc->gen[right] &&
|
||||||
node->u.w == value->disp.w) {
|
node->u.w == value->disp.w) {
|
||||||
del_node(prev, node);
|
del_node(prev, node);
|
||||||
|
@ -2818,7 +2820,6 @@ _simplify_stxi(jit_state_t *_jit, jit_node_t *prev, jit_node_t *node)
|
||||||
default: abort();
|
default: abort();
|
||||||
}
|
}
|
||||||
value->kind = jit_kind_code;
|
value->kind = jit_kind_code;
|
||||||
value->code = node->code;
|
|
||||||
value->base.q.l = right;
|
value->base.q.l = right;
|
||||||
value->base.q.h = _jitc->gen[right];
|
value->base.q.h = _jitc->gen[right];
|
||||||
value->disp.w = node->u.w;
|
value->disp.w = node->u.w;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue