Further optimize inc/decsp
The optimizer can now merge incsp+decsp together, and merge jsr incsp/decsp + jmp incsp/decsp together. Drop the code altogether if both instructions cancel each other out. Fixes #2748
This commit is contained in:
@@ -907,6 +907,11 @@ static unsigned RunOptGroup7 (CodeSeg* S)
|
||||
between branches */
|
||||
C += RunOptFunc (S, &DOptBranchDist, 3);
|
||||
|
||||
/* Re-optimize inc/decsp that may now be grouped */
|
||||
C += RunOptFunc (S, &DOptStackPtrOps, 5);
|
||||
/* Re-optimize JSR/RTS that may now be grouped */
|
||||
C += RunOptFunc (S, &DOptRTS, 1);
|
||||
|
||||
Changes += C;
|
||||
/* If we had changes, we must run dead code elimination again,
|
||||
** since the changes may have introduced dead code.
|
||||
|
||||
Reference in New Issue
Block a user