florian
5f2410b871
* patch by J. Gareth Moreton to fix an ie 2018061400 on darwin
...
git-svn-id: trunk@43694 -
2019-12-16 21:15:57 +00:00
florian
ef7e4f6f62
* fix J. Gareth Moreton to resolve #36389
...
git-svn-id: trunk@43670 -
2019-12-09 22:00:45 +00:00
florian
b8a78b135c
* simplified and improved TX86AsmOptimizer.RegModifiedByInstruction
...
git-svn-id: trunk@43623 -
2019-12-01 22:15:48 +00:00
florian
4525edd9f7
* patch by J. Gareth Moreton: x86 implementation of RegModifiedByInstruction, resolves #36376
...
git-svn-id: trunk@43611 -
2019-11-29 21:57:53 +00:00
florian
7000d82dcd
* do not convert cmp 0,... into test ...,... before the post pass of the peephole optimizer
...
as this conversion might result in missing further optimizer opportunities
git-svn-id: trunk@43596 -
2019-11-26 22:09:34 +00:00
florian
7e6eeebdf0
o patch by J. Gareth Moreton, seeks to improve maintainability, safety and efficiency
...
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 -
2019-11-26 22:09:33 +00:00
florian
cf0716123c
* avoid overflow error
...
git-svn-id: trunk@43593 -
2019-11-26 19:39:04 +00:00
florian
af107ca8fe
o patch by J. Gareth Moreton, resolves #36355
...
+ 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 -
2019-11-25 21:15:41 +00:00
florian
c6116258fd
o patch by J. Gareth Moreton:
...
* 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 -
2019-11-24 20:26:02 +00:00
florian
94b728005d
* more RemoveCurrentP usage
...
git-svn-id: trunk@43576 -
2019-11-24 19:51:04 +00:00
florian
d444f750f9
* factored out TX86AsmOptimizer.OptPass1Cmp
...
* fixed it
* activated it for x86-64
git-svn-id: trunk@43574 -
2019-11-24 16:33:50 +00:00
florian
f5caa9940b
* make use of RemoveCurrentP
...
git-svn-id: trunk@43532 -
2019-11-21 20:19:49 +00:00
pierre
ff415ba39c
Fixes by Gareth Moreton for problems exposed by use of -CriotR option
...
git-svn-id: trunk@43529 -
2019-11-21 10:00:20 +00:00
florian
40c54e9d37
* do not generate conditional jump with full references
...
+ more assembler optimizer output
git-svn-id: trunk@43520 -
2019-11-20 22:12:27 +00:00
florian
6bed497c7c
* be carefully with references using RIP when doing LeaOp2Op optimizations
...
git-svn-id: trunk@43460 -
2019-11-13 20:47:40 +00:00
florian
ae6b204c94
+ added comments for LeaOp2Op
...
git-svn-id: trunk@43457 -
2019-11-12 22:10:01 +00:00
florian
7ee0ad4d63
+ LeaOp2Op optimization
...
* replaced some manual removels of p by RemoveCurrentP calls
git-svn-id: trunk@43456 -
2019-11-12 22:04:23 +00:00
florian
5c0a5b73c7
* patch by J. Gareth Moreton: fix compilation with debug info after r43441 and friends, resolves #36299
...
git-svn-id: trunk@43455 -
2019-11-12 20:03:19 +00:00
florian
1d6e719e38
* improve ShlAddLeaSubIncDec2Lea to take care of foldable LEAs
...
git-svn-id: trunk@43453 -
2019-11-11 22:08:17 +00:00
florian
83a11c2a7d
* patch by J. Gareth Moreton to clean up TX86AsmOptimizer.OptPass2Jcc, resolves #36295
...
git-svn-id: trunk@43452 -
2019-11-11 21:29:13 +00:00
florian
7464c88003
* fix and improve MovImul2Imul: we cannot insert the move target into imul if the imul is 64 bit and the mov 32 bit as
...
we cannot ensure that the upper 32 bits of the move target are really clear
git-svn-id: trunk@43447 -
2019-11-10 21:09:06 +00:00
florian
4b455600b8
* swapped decrefs and StripLabelFast as proposed by Gareth on the mailing list
...
git-svn-id: trunk@43445 -
2019-11-10 18:23:50 +00:00
florian
2d295a3816
* patch by J. Gareth Moreton, issue #36271 , part 2: x86 specific rework of the jump optimizer
...
git-svn-id: trunk@43440 -
2019-11-10 16:11:39 +00:00
florian
20a47afe13
* more aggressive LeaCallLeaRet2Jmp
...
git-svn-id: trunk@43373 -
2019-11-02 22:37:31 +00:00
florian
1fc7667b3b
+ LeaCallLeaRet2Jmp
...
git-svn-id: trunk@43372 -
2019-11-02 22:37:30 +00:00
florian
6842c5784d
* CallRet2Jmp works with PIC
...
git-svn-id: trunk@43371 -
2019-11-02 22:37:29 +00:00
florian
3487c34ed9
* unified TX86AsmOptimizer.OptPass1MOVAP and TX86AsmOptimizer.OptPass1VMOVAP
...
git-svn-id: trunk@43370 -
2019-11-02 18:48:23 +00:00
florian
f9530437c2
* fix i386 building
...
git-svn-id: trunk@43369 -
2019-11-02 18:34:53 +00:00
florian
c3ef42b164
* allow cmov with memory reference if it is a pure symbol or a rip relative symbol: as the symbol is
...
allocated within the image of the program, this should never cause a seg. fault, so it is save
to use cmov with it
git-svn-id: trunk@43368 -
2019-11-02 18:09:11 +00:00
florian
172a4a999b
+ MovMov2Mov 6 and MovMov2Mov 7 optimization
...
git-svn-id: trunk@43339 -
2019-10-30 22:39:13 +00:00
florian
cfec725195
* clean up TX86AsmOptimizer.OptPass1MOV
...
git-svn-id: trunk@43336 -
2019-10-30 20:07:26 +00:00
florian
533a113885
+ LeaCallLeaRet2Jmp optimization
...
git-svn-id: trunk@43178 -
2019-10-12 21:51:15 +00:00
florian
00c2fd4005
+ x86: LeaLea2Lea optimization
...
git-svn-id: trunk@43177 -
2019-10-12 21:51:14 +00:00
pierre
af03c0208b
Use tcgint typecast instead of aint, as it is the type of the second parameter of loadconst taicpu method
...
git-svn-id: trunk@42281 -
2019-06-25 04:24:56 +00:00
Jonas Maebe
281b3ad276
* fix case completeness and unreachable code warnings in compiler that would
...
be introduced by the next commit
git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
florian
d657373933
* patch by J. Gareth Moreton which avoids that the optimizer causes reads of invalid memory, resolves #35187
...
git-svn-id: trunk@41667 -
2019-03-10 10:48:50 +00:00
florian
c7bb028d35
* factored out OptPass1FLD, used bx x86-64 now as well
...
- removed unused function
git-svn-id: trunk@41061 -
2019-01-24 20:10:29 +00:00
florian
6cb6517411
* better recognization of procedure exit code
...
git-svn-id: trunk@41060 -
2019-01-24 19:53:51 +00:00
florian
24f6cc0da5
* factored out OptPass1FSTP, used by x86-64 now as well
...
git-svn-id: trunk@41059 -
2019-01-24 19:38:32 +00:00
florian
cfd0790f89
* avoid assembler errors for the MovOpMov2MovOp optimziation in case the size of the instruction
...
gets changed and the first one contains a constant, resolves #34933
git-svn-id: trunk@41021 -
2019-01-23 21:02:14 +00:00
florian
4fb7b5d3ff
* fix MovOpMov2MovOp optimization if no -Cpcoreavx2 is used
...
git-svn-id: trunk@40979 -
2019-01-21 21:57:07 +00:00
florian
75a89d2115
* fix and enable MovOpMov2MovOp optimization on x86-64
...
git-svn-id: trunk@40941 -
2019-01-20 17:00:43 +00:00
florian
94d7a02fae
* modified patch by Gareth Moreton to pool TmpUsedRegs in the assembler optimizers, resolves #34679
...
git-svn-id: trunk@40938 -
2019-01-20 14:16:38 +00:00
Jonas Maebe
122d0d36d6
+ volatile() expression that marks an expression as volatile
...
* disable matching volatile references in the assembler optimisers, so they
can't be removed (more conservative than needed, but better than removing
too many)
o the CSE optimiser will ignore them by default, because they're an unknown
inline node for it
* also removed no longer used fpc_in_move_x and fpc_in_fillchar_x inline node
identifiers from rtl/inc/innr.inc, and placed fpc_in_unaligned_x at the
right place
git-svn-id: trunk@40465 -
2018-12-04 19:53:20 +00:00
florian
c43cae9231
* disable MovOpMov2MovOp optimization on x86-64 for now as it seems to break
...
git-svn-id: trunk@40361 -
2018-11-21 21:22:54 +00:00
florian
477d7be651
* building on i386-linux fixed
...
git-svn-id: trunk@40360 -
2018-11-21 19:19:24 +00:00
florian
ac37a54d79
+ MovOpMov2MovOp optimization
...
git-svn-id: trunk@40359 -
2018-11-20 22:20:43 +00:00
yury
30d64cec68
* Removed unused local vars.
...
git-svn-id: trunk@40185 -
2018-11-02 18:51:19 +00:00
yury
4357caaad8
* Removed unused local vars.
...
git-svn-id: trunk@40183 -
2018-11-02 18:44:29 +00:00
florian
59d5d6ec95
+ factored out TX86AsmOptimizer.PrePeepholeOptIMUL, used now by x86-64 and i386
...
* generalized and simplified the code
git-svn-id: trunk@40162 -
2018-11-01 20:49:20 +00:00