mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
At the end of the optimizer run, remove jump cascades again. fixes the
regression reported in #1652
This commit is contained in:
parent
8ec41083e9
commit
4285a30236
@ -117,6 +117,7 @@ static OptFunc DOptBNegAX3 = { OptBNegAX3, "OptBNegAX3", 100, 0,
|
|||||||
static OptFunc DOptBNegAX4 = { OptBNegAX4, "OptBNegAX4", 100, 0, 0, 0, 0, 0 };
|
static OptFunc DOptBNegAX4 = { OptBNegAX4, "OptBNegAX4", 100, 0, 0, 0, 0, 0 };
|
||||||
static OptFunc DOptBoolTrans = { OptBoolTrans, "OptBoolTrans", 100, 0, 0, 0, 0, 0 };
|
static OptFunc DOptBoolTrans = { OptBoolTrans, "OptBoolTrans", 100, 0, 0, 0, 0, 0 };
|
||||||
static OptFunc DOptBranchDist = { OptBranchDist, "OptBranchDist", 0, 0, 0, 0, 0, 0 };
|
static OptFunc DOptBranchDist = { OptBranchDist, "OptBranchDist", 0, 0, 0, 0, 0, 0 };
|
||||||
|
static OptFunc DOptBranchDist2 = { OptBranchDist2, "OptBranchDist2", 0, 0, 0, 0, 0, 0 };
|
||||||
static OptFunc DOptCmp1 = { OptCmp1, "OptCmp1", 42, 0, 0, 0, 0, 0 };
|
static OptFunc DOptCmp1 = { OptCmp1, "OptCmp1", 42, 0, 0, 0, 0, 0 };
|
||||||
static OptFunc DOptCmp2 = { OptCmp2, "OptCmp2", 85, 0, 0, 0, 0, 0 };
|
static OptFunc DOptCmp2 = { OptCmp2, "OptCmp2", 85, 0, 0, 0, 0, 0 };
|
||||||
static OptFunc DOptCmp3 = { OptCmp3, "OptCmp3", 75, 0, 0, 0, 0, 0 };
|
static OptFunc DOptCmp3 = { OptCmp3, "OptCmp3", 75, 0, 0, 0, 0, 0 };
|
||||||
@ -222,6 +223,7 @@ static OptFunc* OptFuncs[] = {
|
|||||||
&DOptBNegAX4,
|
&DOptBNegAX4,
|
||||||
&DOptBoolTrans,
|
&DOptBoolTrans,
|
||||||
&DOptBranchDist,
|
&DOptBranchDist,
|
||||||
|
&DOptBranchDist2,
|
||||||
&DOptCmp1,
|
&DOptCmp1,
|
||||||
&DOptCmp2,
|
&DOptCmp2,
|
||||||
&DOptCmp3,
|
&DOptCmp3,
|
||||||
@ -849,6 +851,10 @@ static unsigned RunOptGroup7 (CodeSeg* S)
|
|||||||
/* Replace JSR followed by RTS to JMP */
|
/* Replace JSR followed by RTS to JMP */
|
||||||
C += RunOptFunc (S, &DOptRTS, 1);
|
C += RunOptFunc (S, &DOptRTS, 1);
|
||||||
|
|
||||||
|
/* Replace JMP/BRA to JMP by direct JMP */
|
||||||
|
C += RunOptFunc (S, &DOptJumpCascades, 1);
|
||||||
|
C += RunOptFunc (S, &DOptBranchDist2, 1);
|
||||||
|
|
||||||
Changes += C;
|
Changes += C;
|
||||||
/* If we had changes, we must run dead code elimination again,
|
/* If we had changes, we must run dead code elimination again,
|
||||||
** since the changes may have introduced dead code.
|
** since the changes may have introduced dead code.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user