Merge pull request #2735 from kugelfuhr/kugelfuhr/fix-2025
Add an optimization that removes compare instructions preceeding RTS or function calls
This commit is contained in:
@@ -133,6 +133,7 @@ static OptFunc DOptCmp2 = { OptCmp2, "OptCmp2", 85, 0,
|
||||
static OptFunc DOptCmp3 = { OptCmp3, "OptCmp3", 75, 0, 0, 0, 0, 0 };
|
||||
static OptFunc DOptCmp4 = { OptCmp4, "OptCmp4", 75, 0, 0, 0, 0, 0 };
|
||||
static OptFunc DOptCmp5 = { OptCmp5, "OptCmp5", 100, 0, 0, 0, 0, 0 };
|
||||
static OptFunc DOptCmp6 = { OptCmp6, "OptCmp6", 33, 0, 0, 0, 0, 0 };
|
||||
static OptFunc DOptCmp7 = { OptCmp7, "OptCmp7", 85, 0, 0, 0, 0, 0 };
|
||||
static OptFunc DOptCmp8 = { OptCmp8, "OptCmp8", 50, 0, 0, 0, 0, 0 };
|
||||
static OptFunc DOptCmp9 = { OptCmp9, "OptCmp9", 85, 0, 0, 0, 0, 0 };
|
||||
@@ -255,6 +256,7 @@ static OptFunc* OptFuncs[] = {
|
||||
&DOptCmp3,
|
||||
&DOptCmp4,
|
||||
&DOptCmp5,
|
||||
&DOptCmp6,
|
||||
&DOptCmp7,
|
||||
&DOptCmp8,
|
||||
&DOptCmp9,
|
||||
@@ -729,6 +731,7 @@ static unsigned RunOptGroup3 (CodeSeg* S)
|
||||
C += RunOptFunc (S, &DOptCondBranch3, 1);
|
||||
C += RunOptFunc (S, &DOptCondBranchC, 1);
|
||||
C += RunOptFunc (S, &DOptRTSJumps1, 1);
|
||||
C += RunOptFunc (S, &DOptCmp6, 1); /* After OptRTSJumps1 */
|
||||
C += RunOptFunc (S, &DOptBoolCmp, 1);
|
||||
C += RunOptFunc (S, &DOptBoolTrans, 1);
|
||||
C += RunOptFunc (S, &DOptBNegA2, 1); /* After OptCondBranch's */
|
||||
|
||||
Reference in New Issue
Block a user