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 -
(mantis #12685 and also the error message noted in mantis #12576,
although in case of the latter it's only a symptom of another bug)
git-svn-id: trunk@12199 -
procedure too complex
* use separate includes so they can be regenerated
with simple unix commands that are listed in fpmake.pp
git-svn-id: trunk@12162 -
before optimising function result assignment, because at this point the
hidden self parameter is not yet inserted (mantis #12597)
* changed ttypeconvnode.actualtargetnode to use the same logic as what
is used to determine whether something can be assigned to the result
of a type conversion (so the above check also works if the methodpointer
contains a typecast to a different object type)
git-svn-id: trunk@12038 -
* store a node's verbosity in the node so that e.g. disabling warnings
also disables warnings for this node in pass_1
(the above together fix mantis #12076)
* save/restore verbosity with {$push}/{$pop} (mantis #12075)
* if warnings/notes/hints are turned off, also do not count encountered
ones for the totals (otherwise -Sew cannot be used properly in
combination with {$warnings off}, because disabled warnings will still
trigger a compiler error) -- this required adding -vw/-vn/-vh to all
tests using -Sew/-Sen/-Seh
- removed some superfluous state saving/restoring from firstpass()
git-svn-id: trunk@12025 -
the syntax is exactly the same as for "external", except for
the keyword. It is currently only active for Darwin targets.
It should also work at least for Linux targets, but only with
the GNU assembler (which is why it is not activated there)
+ test for this functionality
git-svn-id: trunk@12009 -
+ -vm<x>,<y> parameter to mask messages <x> and <y>
(both based on a patch submitted by Petr Kristan)
* alphabetically ordered -v<x> option processing code so it's easier
to see which characters are still free (not many anymore)
+ some tests for the -vm functionality
git-svn-id: trunk@11888 -
- Bug fix in the template parser. Bug0012095
- Fixed: CGI applications did not create and populate contentfields (caused AV if someone
tried to access it) for the http request, both the query and content parameters were put
into the queryfields list
- Bug0012094 fix: CGI applications AllowDefaultModule=true did not work for Delphi style calls (it is ok
for querystring parameter passed module names)
- fptemplate.pp->TTemplateParser: Added support for template tag parameters.
git-svn-id: trunk@11747 -
* replace derefnode with resolveppuidx method that only needs to be
implemented for nodes referencing other nodes
* fix IE when a label is not defined in inline function
git-svn-id: trunk@11697 -
* handle function results correctly in life dfa
* handle for loops with at least one iteration better in life dfa
o resolves#8151
git-svn-id: trunk@11624 -
- added goption.inc with apropriate glib symbols
- added gincludes.inc which contains all other include files (similar to
gtk/gdk bindings and simlify inclusion into glib2.pas)
- checked/corrected all the .inc files and make them follow to template used in gtk/gdk (4 sections:
read_forward_definitions, read_interface_types, read_interface_rest, read_implementation)
- removed from most of .inc files unneeded comments that has been taken from original glib .h files. Some of
them were used by glib devels and others repeats official documentation.
git-svn-id: trunk@11617 -
instance reference (mantis 11896)
* fixed double destructor call in tests/test/cg/tcalcla1.pp which
caused an error after this change
git-svn-id: trunk@11599 -
interfaces, even if they only differ in resulttype (mantis #11862)
* fixing this required that multiple entries for the same method in a
interface vmt are all written out (change in
ImplementedInterface.AddImplProc)
git-svn-id: trunk@11595 -
release and patch level are always two digits so the version can
be compared numerically: so 2.2.2 results in 20202, resolves#11568
git-svn-id: trunk@11504 -
* testgen.pp - an utility to convert w3.org tests from XML format
into fpcunit-compatible Pascal source. The official testsuite uses
xslt for conversion, but, since there is no xslt for Pascal, and no
xslt support in FCL yet, I wrote an utility.
* api.xml - API 'database', needed by testgen.
* domunit.pp - an fpcunit extension, provides DOM-specific runtime
support.
* README_DOM - provides some instructions about putting it all together.
git-svn-id: trunk@11390 -
* record symtables are now handled properly as well if a record is copied, resolves#9144
* fixed a memory leak when copying classes
* increased PPU version to 91
git-svn-id: trunk@11273 -
to 0 or field_type(-1) (bug noted by Russell Davies on fpc-devel + his
test programs)
* fixed bit offset calculations for nested bitpacked record regvars
git-svn-id: trunk@11242 -
(and made it future proof in case the set format should change
again, as long as the size of all streamed sets is guaranteed
to be 4 bytes and if their packset setting is guaranteed to
be 0).
git-svn-id: trunk@11149 -
unit has been renamed ObjCRuntime, to avoid a name clash with the
the other Objective-C translation, and this unit is also not included
in the MacOSAll unit
* warning: the FPCMacOSAll unit is now called MacOSAll, to avoid requiring
ifdefs when keeping a program compilable between e.g. GPC and FPC
...
r211 | gale | 2008-03-19 07:41:36 +0100 (Wed, 19 Mar 2008) | 6 lines
Changed paths:
A /metaPascal/trunc/MPPInterfaces/CGLTypes.pas
A /metaPascal/trunc/MPPInterfaces/CVBase.pas
A /metaPascal/trunc/MPPInterfaces/CVBuffer.pas
A /metaPascal/trunc/MPPInterfaces/CVDisplayLink.pas
A /metaPascal/trunc/MPPInterfaces/CVHostTime.pas
A /metaPascal/trunc/MPPInterfaces/CVImageBuffer.pas
A /metaPascal/trunc/MPPInterfaces/CVPixelBuffer.pas
A /metaPascal/trunc/MPPInterfaces/CVPixelBufferPool.pas
A /metaPascal/trunc/MPPInterfaces/CVPixelFormatDescription.pas
A /metaPascal/trunc/MPPInterfaces/CVReturns.pas
Initial translations of CGLTypes.h, CVBase.h, CVBuffer.h, CVDisplayLink.h,
CVHostTime.h, CVImageBuffer.h, CVPixelBuffer.h, CVPixelBufferPool.h,
CVPixelFormatDescription.h, and CVReturn.h from MacOSX10.4u.sdk. To avoid a GPC
identifier redeclaration problem, Pascal unit and file name corresponding to
CVReturn.h uses a "s" suffix.
...
r212 | gale | 2008-03-19 09:55:13 +0100 (Wed, 19 Mar 2008) | 4 lines
Changed paths:
D /metaPascal/trunc/MPPInterfaces/CGDisplayFade.pas
A /metaPascal/trunc/MPPInterfaces/CGDisplayFades.pas (from /metaPascal/trunc/MPPInterfaces/CGDisplayFade.pas:210)
M /metaPascal/trunc/MPPInterfaces/CoreGraphics.pas
Renamed CGDisplayFade unit to CGDisplayFades to fix a GPC gpc-20070904
redeclaration issue involving the function CGDisplayFade. Also, updated the
CoreGraphics framework unit's uses clause to reflect the name change.
...
r213 | adriaan | 2008-03-25 09:37:06 +0100 (Tue, 25 Mar 2008) | 1 line
Changed paths:
M /metaPascal/trunc/MPPInterfaces/fp.pas
Fix precision of pi
...
r214 | adriaan | 2008-03-25 09:50:48 +0100 (Tue, 25 Mar 2008) | 1 line
Changed paths:
M /metaPascal/trunc/MPPInterfaces/Menus.pas
Fix byte parameter of GetMenuItemModifiers, SetMenuItemModifiers, GetMenuItemIconHandle and SetMenuItemIconHandle
...
r215 | adriaan | 2008-03-25 12:19:33 +0100 (Tue, 25 Mar 2008) | 1 line
Changed paths:
M /metaPascal/trunc/Scripts/GenerateFile.pl
Use FourCharCode casts for FPC instead of hex numbers.
...
r216 | peter | 2008-03-25 14:20:20 +0100 (Tue, 25 Mar 2008) | 1 line
Changed paths:
M /metaPascal/trunc/Makefile
M /metaPascal/trunc/Scripts/GenerateFile.pl
M /metaPascal/trunc/Scripts/GenerateMakefile.pl
M /metaPascal/trunc/Scripts/make-common-interfaces.pl
XXXMacOSAll -> MacOSAll
...
r217 | adriaan | 2008-03-25 17:52:07 +0100 (Tue, 25 Mar 2008) | 1 line
Changed paths:
M /metaPascal/trunc/MPPInterfaces/CFByteOrders.pas
Fix the result type of CFConvertFloat64SwappedToHost and friends for GPC and MW
...
r218 | gale | 2008-03-26 04:15:58 +0100 (Wed, 26 Mar 2008) | 2 lines
Changed paths:
M /metaPascal/trunc/Scripts/GenerateFile.pl
Increment the GAP version number for tbe upcoming release.
...
r219 | adriaan | 2008-03-26 11:41:37 +0100 (Wed, 26 Mar 2008) | 1 line
Changed paths:
M /metaPascal/trunc/MPPInterfaces/Events.pas
Change KeyMap to packed array of boolean for FPC. Solve GetKeys endian issue on PowerPC for FPC and GPC.
...
r220 | adriaan | 2008-03-26 12:19:19 +0100 (Wed, 26 Mar 2008) | 1 line
Changed paths:
M /metaPascal/trunc/MPPInterfaces/fp.pas
Add pi=system.pi to fp.p for FPC
...
r221 | adriaan | 2008-03-26 12:41:27 +0100 (Wed, 26 Mar 2008) | 1 line
Changed paths:
M /metaPascal/trunc/MPPInterfaces/Menus.pas
Fix GetItemMark and GetItemCmd for FPC and GPC
...
r222 | adriaan | 2008-03-26 16:42:53 +0100 (Wed, 26 Mar 2008) | 1 line
Changed paths:
M /metaPascal/trunc/Scripts/GenerateMakefile.pl
Add support for: make GPC_COMPILER=xxx FPC_COMPILER=yyy compile
...
r223 | adriaan | 2008-03-30 17:25:57 +0200 (Sun, 30 Mar 2008) | 1 line
Changed paths:
M /metaPascal/trunc/Scripts/GenerateFile.pl
Implement 'const var' for GPCt
...
r224 | adriaan | 2008-04-23 18:26:04 +0200 (Wed, 23 Apr 2008) | 1 line
Changed paths:
M /metaPascal/trunc/MPPInterfaces/AIFF.pas
Rename ID in AIFF.pas to ChunkID
...
r225 | adriaan | 2008-04-23 18:34:38 +0200 (Wed, 23 Apr 2008) | 1 line
Changed paths:
A /metaPascal/trunc/MPPInterfaces/ObjC.pas
Add Objective-C Runtime ObjC.pas
...
r226 | adriaan | 2008-05-04 07:19:30 +0200 (Sun, 04 May 2008) | 1 line
Changed paths:
M /metaPascal/trunc/MPPInterfaces/Files.pas
M /metaPascal/trunc/MPPInterfaces/Folders.pas
Introduce DirIDType = SInt32
...
r227 | adriaan | 2008-05-04 11:51:08 +0200 (Sun, 04 May 2008) | 1 line
Changed paths:
M /metaPascal/trunc/MPPInterfaces/CFByteOrders.pas
M /metaPascal/trunc/MPPInterfaces/Events.pas
M /metaPascal/trunc/MPPInterfaces/Menus.pas
M /metaPascal/trunc/MPPInterfaces/ToolUtils.pas
Fix MW warnings for units with an implementation part
...
r228 | adriaan | 2008-05-05 09:13:10 +0200 (Mon, 05 May 2008) | 1 line
Changed paths:
M /metaPascal/trunc/MPPInterfaces/FPCStrings.pas
Fix compile error in FPCStrings.pas
...
r229 | adriaan | 2008-05-05 09:34:13 +0200 (Mon, 05 May 2008) | 1 line
Changed paths:
M /metaPascal/trunc/Scripts/GenerateMacOS.pl
Add GPCStrings.pas (aka FPCStrings.pas) to MacOS.pas
...
r230 | adriaan | 2008-05-06 12:30:18 +0200 (Tue, 06 May 2008) | 1 line
Changed paths:
M /metaPascal/trunc/Scripts/GenerateFile.pl
Set GAP release version to 210 instead of 201
...
r232 | adriaan | 2008-05-07 09:09:30 +0200 (Wed, 07 May 2008) | 1 line
Changed paths:
M /metaPascal/trunc/Scripts/GenerateFile.pl
Fix GPC implemented procedures, functions and constants
...
r233 | adriaan | 2008-05-09 07:55:17 +0200 (Fri, 09 May 2008) | 1 line
Changed paths:
M /metaPascal/trunc/MPPInterfaces/ObjC.pas
Add attribute(ignorable) to objc_msgSend(Super)
...
r234 | adriaan | 2008-05-16 21:09:52 +0200 (Fri, 16 May 2008) | 1 line
Changed paths:
M /metaPascal/trunc/MPPInterfaces/ObjC.pas
Remove FPC implemented functions that reference the ObjC runtime
...
git-svn-id: trunk@11137 -
delta for which 1.0 and 1.0+delta is different, rather than
some power-of-10 ballpark equivalent (fixes mantis #11308)
* print the same number of digits for doubles on systems
which support extended as on those which don't (i.e.,
one digit less on the former). This solves regressions after
the previous change and is Delphi-compatible.
* adapted tests for the previous change
git-svn-id: trunk@11025 -
* Changes for gba:
* Random number generator is now embedded in the rtl
* Improved heap
* Updated the linker script
- Removed the outdated gbaunits library and
+ replaced by libgbafpc package
git-svn-id: trunk@10986 -