Commit Graph

44 Commits

Author SHA1 Message Date
David Chisnall
71c1437ac2 If we find LLVM, but fail to find the relevant cmake modules, give a helpful error and then continue without building the optimisations, instead of just dying. 2015-03-23 14:09:15 +00:00
theraven
3b44e6f97a Fix the build with LLVM 3.3 and enable building the optimisation passes by
default of LLVM 3.3 is found.
2013-05-16 12:04:18 +00:00
theraven
608b330bae Disable RTTI when building LLVM passes.
Patch by Jean-Charles Bertin!
2013-03-01 14:41:30 +00:00
theraven
a27e31e07a Fix optimisations with LLVM trunk. 2013-03-01 11:30:17 +00:00
theraven
0dcb0885bf Update opts to work with LLVM trunk (3.3). 2013-01-10 09:22:25 +00:00
theraven
080107e2db Correctly pass the LLVM version in to the LLVM passes as they are built. 2012-12-17 19:29:39 +00:00
theraven
3b5e00b995 Small improvements to class lookup cache pass. 2012-09-20 13:05:13 +00:00
theraven
31149afd20 Add CMake minimum version. 2012-09-19 12:30:54 +00:00
theraven
86d5f028a4 Don't remove ivar offset variables, even if we aren't using them. 2012-09-19 12:30:18 +00:00
theraven
8cf5e0412f Update optimisation to work with LLVM trunk, remove the Makefile and use CMake for building the passes (out of tree builds are now easier). 2012-08-17 13:18:16 +00:00
theraven
abff244ef9 Started 1.6.1 release announcement, updated LLVM optimisations to work with LLVM 3.1. 2012-04-06 17:46:55 +00:00
buzzdee
5aec1ee728 Allow to build the optimizations for llvm with cmake.
OK loong time ago from David.
2012-02-24 19:10:37 +00:00
theraven
02fe58d85a Fix use-after-free in speculative inlining pass. 2011-11-20 21:21:22 +00:00
theraven
469ce7521c Add missing file. 2011-11-19 12:24:16 +00:00
theraven
f2caea7f28 It turns out that allocating one word on stack every loop iteration doesn't scale very well.
It also turns out that if you test the cache every loop iteration but never write to it that this doesn't really make things any faster...
2011-11-19 11:19:25 +00:00
theraven
d99a8b19ed Remove debugging statements. 2011-11-18 20:54:39 +00:00
theraven
286892936d Teach the optimisations to work in the presence of exception handling and if the front end emits objc_msgSend() instead of indirect lookups.
The GNUstep-base test suite now passes when compiled with:

 -fno-objc-legacy-dispatch -Xclang -load -Xclang /path/to/libGNUObjCRuntime.so -O3
2011-11-18 20:28:02 +00:00
theraven
705135bb89 Some fixes to the Objective-C optimisation passes. Tested by compiling GNUstep base with clang at -O3 + all of the optimisations that this library enables at O3 and then running the test suite - results, looking good. Still to do before the release: turn objc_msgSend() into objc_msg_lookup_sender() and insert caching when not optimising for size. 2011-11-17 23:53:14 +00:00
theraven
ee3961f38e Register LLVM passes with the new API. 2011-08-16 14:00:26 +00:00
theraven
b68a5dda6d Get the libobjc2 optimisations building again with LLVM trunk. 2011-08-16 12:58:44 +00:00
theraven
81131acfbc Fix LLVM trunk compatibility. 2011-07-03 12:52:49 +00:00
theraven
4f31ed8acd Some tweaks to optimisation order. 2011-05-15 13:06:05 +00:00
theraven
2912bae0a7 Ooops, another debugging line left in which caused a pass not to run... 2011-05-14 18:01:38 +00:00
theraven
b7986e9efa Ooops. Accidentally left the bit that actually did the optimisation commented out. 2011-05-14 17:21:39 +00:00
theraven
8f423d0e29 Fix non-fragile ivar short-circuiting (i.e. hard-code the CORRECT ivar addresses, don't make foo and foobar have the same offset). 2011-05-14 16:12:46 +00:00
theraven
5705845e98 Fixed some bugs with the optimisation passes and introduced support for automatically running them (requires LLVM 3 + a patch that is not yet in trunk, but should be soon). 2011-05-14 15:32:26 +00:00
theraven
34aa9f9455 Allowed LLVM optimisations to build against both LLVM 2.9 and LLVM 3.0. 2011-05-05 20:49:47 +00:00
theraven
15ddbdfd71 Added meta-pass that runs all of the LLVM optimisations. 2011-04-22 12:01:28 +00:00
theraven
9d5452b147 Fixed LLVM passes to compile with recent LLVM.
Made class caching pass cache classes in a static variable if the original class is not available.
2011-04-22 11:06:33 +00:00
theraven
0c8d2bd7b8 Added missing files. 2010-05-19 14:16:26 +00:00
theraven
a6b5cd15dc Rename the library with the lib prefix so it can actually be linked sensibly. 2010-05-09 12:28:36 +00:00
theraven
23447feca5 Profile-driven inlining of Objective-C methods. 2010-05-01 18:24:22 +00:00
theraven
9ea9a6cf41 Made inlining conditional on inlining actually being sensible. 2010-05-01 15:54:27 +00:00
theraven
6a58d3d49d Added unfinished inliner that uses type feedback info to inline instance methods.
Made class method inliner also inline message sends to super.

Various updates caused by clang now attaching more sensible metadata to the IR.
2010-05-01 13:56:59 +00:00
theraven
c425b1bfdc Initial (working) type feedback pass. Records the IMP for every message lookup. Note: This writes 3 words for every single message send, which means that it makes code VERY slow and can fill up the filesystem if you leave it enabled.
The aim of this pass is to identify message send sites which can benefit from speculative inlining and inline caching.  By itself, this pass is useless.  It will later be combined with one that parses this information and then uses the existing caching and inlining infrastructure to optimize hot message send sites.

Now, however, it's time for me to go and dance, so the useful bit will have to wait.
2010-04-29 17:56:36 +00:00
theraven
6cac2816cc Added speculative inlining of class messages. Currently inlines all that it can, without deciding whether it's sensible. 2010-04-28 21:27:54 +00:00
theraven
beb8356367 Made ClassIMPCache a ModulePass (it shouldn't be a FunctionPass because it adds globals). 2010-04-28 15:21:23 +00:00
theraven
60f87bc4ad Removed debugging code that shouldn't have been in last commit.
Aside: Testing the two passes from the last commit shows that they provide about a factor of 10 speedup for class messages.
2010-04-28 14:47:02 +00:00
theraven
84b41a8464 Added -gnu-class-lookup-cache and -gnu-class-imp-cache passes. These add caching for class messages and also skip the class lookup (using the class symbol directly) where possible.
In combination, these make class messages marginally slower than function calls, rather than significantly slower than message sends.
2010-04-28 14:33:52 +00:00
theraven
352dfe2d93 Removed some unneeded #includes. 2010-04-28 12:24:03 +00:00
theraven
874ec4bd66 Fixed IMP cacher to not cache the slot if the lookup function changes the receiver (this could result in a method being called on the wrong receiver, which would just be confusing). 2010-04-28 12:20:26 +00:00
theraven
dfc4a0286b Factored out code that performs IMP caching into a separate class. This can now be used by other passes that cache IMPs outside of loops (for example, always caching class messages because they always have the same receiver). 2010-04-28 11:38:31 +00:00
theraven
1918888ce1 Added LoopIMPCachePass. This pass automatically performs IMP caching on all loops.
Microbenchmark that just sends a message that does nothing 1000000000 times in a loop goes from taking 10.2 seconds to taking 4.7 after running the pass.
2010-04-27 22:34:15 +00:00
theraven
93251416eb Added LLVM optimisation passes for libobjc2. 2010-03-13 18:43:56 +00:00