Commit Graph

60 Commits

Author SHA1 Message Date
florian
529091f620 * fixed test runner directives 2025-01-26 10:53:22 +01:00
Pierre Muller
a3b730b0f1 Add POPCNTSupport call to avoid use of unsupported instruction 2024-02-15 09:01:04 +00:00
florian
3fa77a4f62 * fix life information propagation for while loops, resolves #39971
* warnings/errors fixed which are caused by the new life information propagation
  + test
2022-10-24 22:13:43 +02:00
J. Gareth "Curious Kit" Moreton
fd54c958c9 New POPCNT tests to evaluate new optimisations 2022-01-06 20:57:48 +00:00
florian
5aa3da26f5 * fix test for targets with little memory
git-svn-id: trunk@46693 -
2020-08-25 21:39:38 +00:00
Jonas Maebe
23428dbf4c * replaced non-breaking space with space (patch by J. Gareth Moreton,
mantis #35602)

git-svn-id: trunk@42105 -
2019-05-19 19:20:51 +00:00
Jonas Maebe
7e51c5e856 * DFA now takes case-completeness into account (mantis #35598)
git-svn-id: trunk@42091 -
2019-05-18 12:01:41 +00:00
pierre
ddf0aab494 Explicitly disabled overflow and range check
git-svn-id: trunk@39267 -
2018-06-21 04:56:32 +00:00
florian
13de8c6808 * -Or => -Ooregvar
git-svn-id: trunk@34931 -
2016-11-20 15:45:01 +00:00
marco
690f784c4d * enable 40+ tests for Haiku as per mantis #30470
git-svn-id: trunk@34312 -
2016-08-14 14:09:24 +00:00
florian
45807056c5 * factored out SymbolCandidateForWarningOrHint
* do not issue a hint if a normal parameter is passed to another procedure by var
+ test

git-svn-id: trunk@33248 -
2016-03-13 19:14:26 +00:00
florian
ecdfe75841 * tests fail if dead values are optimized so disable dead value optimization for the tests
git-svn-id: trunk@26631 -
2014-01-30 19:44:12 +00:00
florian
27f6fd1c2c * use new shl/shr constant folding (of r26295) only if forinline is set
* explicitly simplify tree after constant propagation

git-svn-id: trunk@26311 -
2013-12-29 14:09:03 +00:00
florian
739166f3e7 * fix test
git-svn-id: trunk@26308 -
2013-12-29 10:03:41 +00:00
florian
be807d6cef + tests for dead store removal
git-svn-id: trunk@26299 -
2013-12-28 20:19:46 +00:00
florian
99eadb91b3 * run CheckAndWarn to get proper locations for warnings about uninitialized variables
* several fixes to liveness analysis
* get rid of old version defines
+ tests

git-svn-id: trunk@26159 -
2013-12-01 17:01:51 +00:00
florian
92508a9801 * take of life of tlabelnode.left, the test does not test this however because I'am not aware of any example to force a left node for a label
git-svn-id: trunk@26082 -
2013-11-13 19:26:37 +00:00
Jonas Maebe
10ae87f11c * fixed LdrLdr2LdrMov optimisation in case the first and second ldr have
a different size (disable it in that case) + test

git-svn-id: trunk@25778 -
2013-10-14 12:49:34 +00:00
Jonas Maebe
31a3122b91 * fixed LsrAnd2Lsr test by replacing the existing buggy check with comparing
the outcome of the original and the optimised sequence and seeing whether
    it's same + test

git-svn-id: trunk@25776 -
2013-10-14 12:49:28 +00:00
masta
ff95d42216 Fix ShiftShift2Shift 1 ARM-peephole optimizer
The previous code deleted the newly inserted instruction instead of the
existing one, which obviously broke code.

Assembly:
  mov r0, r0, lsr #23
  mov r0, r0, lsr #23

transformed into:
  mov r0, r0, lsr #23

expected was:
  mov r0, #0

The problem only shows up in the very unlikely case of two LSR/ASR or
two LSL following on each other and having a total shift of more than 31
bits.

This fixes test/opt/tarmshift.pp

I've also removed the {%norun} directive from tarmshift.pp as this test
does only make sense when it also runs.

git-svn-id: trunk@25374 -
2013-08-26 17:41:54 +00:00
sergei
37a347ce7b * Another fix to PIC assembler: GOT slot stores the address of variable, not variable itself.
git-svn-id: trunk@24127 -
2013-04-02 10:48:58 +00:00
florian
5b90a02e75 * inherit nf_write/nf_modify in tcallnode.replaceparaload also when replacing parameters
git-svn-id: trunk@22075 -
2012-08-13 15:06:16 +00:00
sergei
34fc366d64 * test/opt/tretopt.pp, test/tasmread.pp: fixed GOT calculation
* test/tcg1.pp: rewrote without PIC, was having the same issue (GOT off by 1), additionally Intel syntax part won't compile anyway. This test is about push/pop encoding, not about PIC.

git-svn-id: trunk@21811 -
2012-07-07 12:03:13 +00:00
Jonas Maebe
9d1063f94c * adjustments/fixes for AIX/ppc64
git-svn-id: trunk@21053 -
2012-04-25 20:28:32 +00:00
Jonas Maebe
51616b7bd6 * enabled a bunch of tests also for aix
git-svn-id: trunk@20821 -
2012-04-11 18:04:57 +00:00
Jonas Maebe
2b0472dce5 + aix/ppc32 support
git-svn-id: trunk@20807 -
2012-04-11 18:02:28 +00:00
florian
6b63837ae7 * rewrote node cse, needs still testing and bug fixing
git-svn-id: trunk@14597 -
2010-01-10 13:38:58 +00:00
florian
701d911f58 * continued on node cse
git-svn-id: trunk@14496 -
2009-12-29 19:45:33 +00:00
paul
da41694995 test: fix tdfa2.pp - it is not a unit
git-svn-id: trunk@14456 -
2009-12-21 06:08:31 +00:00
florian
9955e6b2bf * dfa fixes by Sergei Gorelkin, resolve #15402
git-svn-id: trunk@14455 -
2009-12-20 21:02:11 +00:00
Jonas Maebe
089ff79c3b + test I forgot to commit earlier
git-svn-id: trunk@13309 -
2009-06-21 12:14:14 +00:00
Jonas Maebe
41acad1d11 + keep track of called virtual methods per unit. -Owoptvtms will now replace
vmt entries of virtual methods that can never be called with references
    to FPC_ABSTRACTERROR. Some virtual methods are always considered to be
    reachable: published methods, and methods used as getter/setter for a
    published property.

git-svn-id: trunk@13238 -
2009-06-06 08:24:36 +00:00
Jonas Maebe
2c94fca8e1 * disable debug info generation, because these tests require smart linking,
which is incompatible with smart linking on most platforms

git-svn-id: trunk@12893 -
2009-03-15 12:03:59 +00:00
Jonas Maebe
4bf254bc32 * added .txt extensions to all README, TODO and COPYING files
(mantis #12358)

git-svn-id: trunk@12825 -
2009-02-28 17:34:08 +00:00
Jonas Maebe
47ba5b19ec * ignore vmtloadaddrnodes created in dead strip removed code
for wpo

git-svn-id: trunk@12364 -
2008-12-14 18:56:02 +00:00
Jonas Maebe
060d81b8fa Merged revisions 11878,11881-11882,11889,11891-11893,11895,11899-11902,11935,11938,12212,12304,12308-12310,12316,12330-12332,12334,12339-12340 via svnmerge from
svn+ssh://jonas@svn.freepascal.org/FPC/svn/fpc/branches/wpo

........
r11878 | jonas | 2008-10-11 02:25:18 +0200 (Sat, 11 Oct 2008) | 19 lines

  + initial implementation of whole-program optimisation framework
  + implementation of whole-program devirtualisation
  o use:
     a) generate whole-program optimisation information (no need
        to completely compile the program and all of its units
        with -OW/-FW, only the main program is sufficient)
      fpc -OWdevirtcalls -FWmyprog.wpo myprog
     b) use it to optimise the program
      fpc -B -Owdevirtcalls -Fwmyprog.wpo myprog
     (the -B is not required, but only sources recompiled during
      the second pass will actually be optimised -- if you want,
      you can even rebuild the rtl devirtualised for a particular 
      program; and these options can obviously also be used         
      together with regular optimisation switches)
  o warning:
    - there are no checks yet to ensure that you do not use 
      units optimised for a particular program with another
      program (or with a changed version of the same program)

........
r11881 | jonas | 2008-10-11 19:35:52 +0200 (Sat, 11 Oct 2008) | 13 lines

  * extracted code to detect constructed class/object types from
    tcallnode.gen_vmt_tree into its own method to avoid clutter
  * detect x.classtype.create constructs (with classtype = the
    system.tobject.classtype method), and treat them as if a
    "class of x" has been instantiated rather than a
    "class of tobject". this required storing the instantiated
    classrefs in their own array though, because at such a
    point we don't have a "class of x" tdef available (so
    now "x", and all other defs instantiated via a classref,
    are now stored as tobjectdefs in a separate array)
  + support for devirtualising class methods (including
    constructors)

........
r11882 | jonas | 2008-10-11 20:44:02 +0200 (Sat, 11 Oct 2008) | 7 lines

  + -Owoptvmts whole program optimisation which replaces vmt entries
    with method names of child classes in case the current class'
    method can never be called (e.g., because this class is never
    instantiated). As a result, such methods can then be removed
    by dead code removal/smart linking (not much effect for either
    the compiler, lazarus or a trivial lazarus app though).

........
r11889 | jonas | 2008-10-12 14:29:54 +0200 (Sun, 12 Oct 2008) | 2 lines

  * some comment fixes

........
r11891 | jonas | 2008-10-12 18:49:13 +0200 (Sun, 12 Oct 2008) | 4 lines

  * fixed twpofilereader.getnextnoncommentline() when reusing a previously
    read line
  * fixed skipping of unnecessary wpo feedback file sections

........
r11892 | jonas | 2008-10-12 23:42:43 +0200 (Sun, 12 Oct 2008) | 31 lines

  + symbol liveness wpo information extracted from smartlinked programs
    (-OW/-Owsymbolliveness)
  + use symbol liveness information to improve devirtualisation (don't
    consider classes created in code that has been dead code stripped).
    This requires at least two passes of using wpo (first uses dead code
    info to locate classes that are constructed only in dead code,
    second pass uses this info to potentially further devirtualise).
    I.e.:
     1) generate initial liveness and devirtualisation feedback
       fpc -FWtt.wpo -OWall tt.pp -Xs- -CX -XX
     2) use previously generated feedback, and regenerate new feedback
        based on this (i.e., disregard classes created in dead code)
       fpc -FWtt-1.wpo -OWall -Fwtt.wo -Owall tt.pp -Xs- -CX -XX
     3) use the newly generated feedback (in theory, it is possible
        that even more opportunities pop up afterwards; you can
        continue until the program does not get smaller anymore)
       fpc -Fwtt-1.wpo -Owall tt.pp -CX -XX
  * changed all message() to cgmessage() calls so the set codegenerror
  * changed static fsectionhandlers field to a regular field called
    fwpocomponents
  * changed registration of wpocomponents: no longer happens in the
    initialization section of their unit, but in the InitWpo routine
    (which has been moved from the woinfo to the wpo unit). This way
    you can register different classes based on the target/parameters.
  + added static method to twpocomponentbase for checking whether
    the command line parameters don't conflict with the requested
    optimisations (e.g. generating liveness info requires that
    smartlinking is turned on)
  + added static method to twpocomponentbase to request the
    section name

........
r11893 | jonas | 2008-10-12 23:53:57 +0200 (Sun, 12 Oct 2008) | 3 lines

  * fixed comment error (twpodeadcodeinfo keeps a list of live,
    not dead symbols)

........
r11895 | jonas | 2008-10-13 00:13:59 +0200 (Mon, 13 Oct 2008) | 2 lines

  + documented -OW<x>, -Ow<x>, -FW<x> and -Fw<x> wpo parameters

........
r11899 | jonas | 2008-10-14 22:14:56 +0200 (Tue, 14 Oct 2008) | 2 lines

  * replaced hardcoded string with objdumpsearchstr constant

........
r11900 | jonas | 2008-10-14 22:15:25 +0200 (Tue, 14 Oct 2008) | 2 lines

  * reset wpofeedbackinput and wpofeedbackoutput in wpodone

........
r11901 | jonas | 2008-10-14 22:16:07 +0200 (Tue, 14 Oct 2008) | 2 lines

  * various additional comments and comment fixes

........
r11902 | jonas | 2008-10-15 18:09:42 +0200 (Wed, 15 Oct 2008) | 5 lines

  * store vmt procdefs in the ppu files so we don't have to use a hack to
    regenerate them for whole-program optimisation
  * fixed crash when performing devirtualisation optimisation on programs
    that do not construct any classes/objects with optimisable vmts

........
r11935 | jonas | 2008-10-19 12:24:26 +0200 (Sun, 19 Oct 2008) | 4 lines

  * set the vmt entries of non-class virtual methods of not instantiated
    objects/classes to FPC_ABSTRACTERROR so the code they refer to can
    be thrown away if it is not referred to in any other way either

........
r11938 | jonas | 2008-10-19 20:55:02 +0200 (Sun, 19 Oct 2008) | 7 lines

  * record all classrefdefs/objdefs for which a loadvmtaddrnode is generated,
    and instead of marking all classes that derive from instantiated
    classrefdefs as instantiated, only mark those classes from the above
    collection that derive from instantiated classrefdefs as
    instantiated (since to instantiate a class, you have to load its vmt
    somehow -- this may be broken by using assembler code though)

........
r12212 | jonas | 2008-11-23 12:26:34 +0100 (Sun, 23 Nov 2008) | 3 lines

  * fixed to work with the new vmtentries that are always available and
    removed previously added code to save/load vmtentries to ppu files

........
r12304 | jonas | 2008-12-05 22:23:30 +0100 (Fri, 05 Dec 2008) | 4 lines

  * check whether the correct wpo feedback file is used in the current
    compilation when using units that were compiled using wpo information
    during a previous compilation run

........
r12308 | jonas | 2008-12-06 18:03:39 +0100 (Sat, 06 Dec 2008) | 2 lines

  * abort compilation if an error occurred during wpo initialisation

........
r12309 | jonas | 2008-12-06 18:04:28 +0100 (Sat, 06 Dec 2008) | 3 lines

  * give an error message instead of crashing with an io exception if the
    compiler is unable to create the wpo feedback file specified using -FW

........
r12310 | jonas | 2008-12-06 18:12:43 +0100 (Sat, 06 Dec 2008) | 3 lines

  * don't let the used wpo feedback file influence the interface crc (there's
    a separate check for such changes)

........
r12316 | jonas | 2008-12-08 19:08:25 +0100 (Mon, 08 Dec 2008) | 3 lines

  * document the format of the sections of the wpo feedback file inside the
    feedback file itself

........
r12330 | jonas | 2008-12-10 22:26:47 +0100 (Wed, 10 Dec 2008) | 2 lines

  * use sysutils instead of dos to avoid command line length limits

........
r12331 | jonas | 2008-12-10 22:31:11 +0100 (Wed, 10 Dec 2008) | 3 lines

  + support for testing whole program optimisation tests (multiple
    compilations using successively generated feedback files)

........
r12332 | jonas | 2008-12-10 22:31:40 +0100 (Wed, 10 Dec 2008) | 2 lines

  + whole program optimisation tests

........
r12334 | jonas | 2008-12-10 22:38:07 +0100 (Wed, 10 Dec 2008) | 2 lines

  - removed unused local variable

........
r12339 | jonas | 2008-12-11 18:06:36 +0100 (Thu, 11 Dec 2008) | 2 lines

  + comments for newly added fields to tobjectdef for devirtualisation

........
r12340 | jonas | 2008-12-11 18:10:01 +0100 (Thu, 11 Dec 2008) | 2 lines

  * increase ppu version (was no longer different from trunk due to merging)

........

git-svn-id: trunk@12341 -
2008-12-11 17:40:18 +00:00
florian
66e015f48c * avoid shifter constant overflow on arm when optimizing two shifter operations into one
git-svn-id: trunk@11474 -
2008-07-28 15:51:58 +00:00
florian
8fe43377e1 + convert case <boolean> of into if statement, resolves #10517
git-svn-id: trunk@10873 -
2008-05-03 10:27:55 +00:00
Jonas Maebe
61522d00a2 * fixed tests now that i386 assembler code is checked for correct PIC
usage in case PIC generation is on (some by adding PIC-versions of
    the assembler code, most by adding -Cg- to the options to be used).

    Note: the Intel assembler reader does not yet support the Delphi
    PIC construct, so tests with that (like test/tasmread and test/tcg1)
    do not work with -Cg on non-Darwin (Darwin needs a different PIC
    construct)

git-svn-id: trunk@9370 -
2007-12-01 14:34:50 +00:00
Jonas Maebe
7453e2a72d * ifdef cpupowerpc -> ifdef cpupowerpc32
git-svn-id: trunk@9056 -
2007-11-02 09:51:23 +00:00
Jonas Maebe
c03f19fa50 * in case of "movzbl %dl,%edx" etc, %edx depends on its previous value.
regloadedwithnewvalue() gave the wrong answer for this in case
    candependonprevvalue was false (caused a wrong optimization in the
    space() function of the rtl)

git-svn-id: trunk@8808 -
2007-10-14 20:22:23 +00:00
Jonas Maebe
b546309ca0 * enabled assembler test for ppc64
git-svn-id: trunk@8392 -
2007-09-07 10:48:32 +00:00
Jonas Maebe
fdf8980856 * improved test
git-svn-id: trunk@8381 -
2007-09-04 17:33:59 +00:00
Jonas Maebe
dcb69b44b9 * fixed some test/opt tests
+ include test/opt directory in Makefile

git-svn-id: trunk@8198 -
2007-07-29 19:35:52 +00:00
Jonas Maebe
ba2922ebed * forgot to call testrec3inl
git-svn-id: trunk@8196 -
2007-07-29 17:50:31 +00:00
Jonas Maebe
f4e6a6bea0 * extended even more (and now also fails)
git-svn-id: trunk@8195 -
2007-07-29 17:48:46 +00:00
Jonas Maebe
6dfb507c8a * extended more
git-svn-id: trunk@8194 -
2007-07-29 17:35:34 +00:00
Jonas Maebe
caec7ab689 * extended test
git-svn-id: trunk@8192 -
2007-07-29 15:59:17 +00:00
Jonas Maebe
b61e89b04e + test for optimization of invisible function result parameters
in assignment statements

git-svn-id: trunk@8181 -
2007-07-28 14:51:11 +00:00
Jonas Maebe
95a44d5beb * fixed
git-svn-id: trunk@2551 -
2006-02-12 21:31:25 +00:00