* applies some optimisations to OptPass1MOV. Repeated checks to the "GetNextInstruction_p Boolean"
variable are factored out, since all of the optimisations bar the first one require a
succeeding instruction.
git-svn-id: trunk@43875 -
o they are implemented as a new metadata register class, whereby the
subregister indicates the metadata type (currently always a string)
and the superregister is an index in the metadata array (which
contains the strings). LLVM metadata can only be passed as parameters
to intrinsics in bitcode, so moves of metadata into other registers
triggers internal errors and when moving them into parameters, we
replace the parameter's register with the metadata register (and look
up the corresponding string when writing out the bitcode)
git-svn-id: trunk@43816 -
o fixes several places where there was a check whether something is a
fieldvarsym, but not whether it's an instance rather than a class field
git-svn-id: trunk@43786 -
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 -
* adds an extra optimisation to "PostPeepholeOptMov" in compiler/x86/aoptx86.pas:
If the instruction "MOV REG, -1" (Intel notation) is found, where REG is either
a 32- or 64-bit register, it is changed to "OR REG, -1" instead.
The effect is the same and takes exactly the same speed to execute, but the encoding is much smaller.
As it cause false data dependencies, it is only applied in -Os mode
For 16-bit registers, only AX is optimised this way because it has its own encoding for OR that takes fewer bytes.
git-svn-id: trunk@43579 -