MIPS conditional instructions conntain the
computation of the condition itself, so
changing the instruction to unconditional
should never be done.
* TAOptObj.OptimizeConditionalJump: Return false early if
the conditional instruction has more than one operand.
git-svn-id: trunk@45782 -
* This patch makes some minor improvements to the cross-platform code that deals with jump optimisations.
More specifically, it attempts to do more in a single pass which has the nice side-effect of
fixing a couple of minor mistakes (in some situations, it would erroneously remove an alignment entry).
- Most improvements are with dealing with Jcc/JMP pairs and their equivalents on other platforms, by
collapsing label clusters and stripping dead code as soon as it has enough information to do so, and being
more intelligent before calling Continue to see if another optimisation can be performed in the same sitting.
- RemoveDeadCodeAfterJump is now a function that returns True if a jump was found among the dead code,
thus allowing the ability to flag the peephole optimizer for another iteration of Pass 1 - the
destination label may have appeared earlier in the code and become dead as a result of the removal
of the jump, thus opening up new optimisations with instructions that sat either side of the label.
- Preliminary tests show that it does sometimes reduce the number of passes required to optimise a subroutine
under -O3.
git-svn-id: trunk@43668 -
in the peephole optimizer by slightly modifying some function headers based
on their intended purpose, resolves#36353
* Non-virtual methods and class methods that don't need to access any fields from
the current object are now static methods, thus removing the hidden "Self"
parameter and reducing overhead. This includes a large number of
frequently-used functions such as SkipEntryExitMarker and SuperRegistersEqual.
* GetNextInstruction, GetLastInstruction, SkipEntryExitMarker and
SkipLabels have had their 'var' parameter changed to an 'out' parameter because
they shouldn't depend on its input value. This will cause the compiler to throw warnings
if you start using the value without initialising it first, and may open up optimisation
opportunities in the future (e.g. storing written values in a temporary register
and only writing it to the actual variable when the routine exits).
git-svn-id: trunk@43595 -
+ This patch serves to extend the JMP -> RET optimisation in OptPass2JMP by also doing the same
for JMP -> MOV/RET, since there are often cases where the result (e.g. EAX) is set just
prior to the function exiting.
* RemoveDeadCodeAfterJump will now drop out if it detects SEH information -
this stops exception information from being stripped if it is called on the final RET instruction.
git-svn-id: trunk@43592 -
* TAOptObj.CollapseZeroDistJump: Change hp1 to local variable,
initialized as p.next, to avoid problems of dangling pointers
revealed by use of "-CriotR -O2" compilation arguments.
git-svn-id: trunk@43554 -