discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: building llvm optimizations for libobjc2


From: Sebastian Reitenbach
Subject: Re: building llvm optimizations for libobjc2
Date: Thu, 08 Dec 2011 15:48:43 +0100
User-agent: SOGoMail 1.3.10

 
On Thursday, December 8, 2011 13:26 CET, David Chisnall <theraven@sucs.org> 
wrote: 
 
> On 8 Dec 2011, at 12:09, Sebastian Reitenbach wrote:
> 
> > Is there an easy way to get this to work with the cmake build system?
> 
> Possibly...
> 
> > as far as I understand the build_opts.sh right, I'm supposed to run a 
> > build_opts.sh gmake all and then later a build_opts.sh gmake install,
> 
> Correct.
> 
> > which would build the whole llvm/cmake and install the whole llvm/cmake
> 
> No, it will build and install just the optimisations, but it needs to build 
> it inside the LLVM tree currently.
> 
> > . Is there a way to just only build and install the optimizations?
> 
> Yes, build_opts.sh gmake, build_opts.sh gmake install does exactly that, but 
> it requires the LLVM build system to be working.  
> 
> Take a look in llvm/lib/Transforms/Hello.  This is a simple LLVM plugin 
> example that provides both build systems.  You should be able to copy the 
> CMake build system files from that, modify them to match the GNU makefiles 
> for the libobjc2 optimisations, and use it instead.  In theory, this may 
> support out-of-tree building, but I have no idea if that actually works...

thanks, that was a starting point I needed.

I did not got it to build out of tree, but instead of funneling building the 
optimization into the llvm build when building and installing libobjc2, I 
managed to add libobjc2 sources as dependency when building/installing llvm. 
So, now I have a lib/libGNUObjCRuntime.so file installed, but wonder a bit, how 
to make use of it ;)

The README states:
Running GNU make will then create GNUObjCRuntime.so.  This library can be
passed to opt to run optimisations on bitcode generated with clang or
LanguageKit.

but unfortunately, this doesn't tells me much :(

man opt tells me, its the llvm optimizer, 
reading further, I should do 
opt -load=libGNUObjCRuntime.so -gnu-nonfragile-ivar -gnu-objc-type-feedback 
<inputfile>

but what is the inputfile, would it be libgnustep-base.so.X.X ??
Shall I need to do this for libraries, binaries, or both?
Can gnustep-make do this for me "automagically" when I give an environment 
variable?

Or, where do I find the RTFM on that topic? 

cheers,
Sebastian

> 
> David
> 
> -- Sent from my Cray X1
> 
 

cat lib/Transforms/GNURuntime/CMakeLists.txt
 add_llvm_loadable_module( libGNUObjCRuntime
  ClassIMPCache.cpp
  ClassMethodInliner.cpp
  IvarPass.cpp
  ObjectiveCOpts.cpp
  TypeFeedbackDrivenInliner.cpp
  ClassLookupCache.cpp
  IMPCacher.cpp
  LoopIMPCachePass.cpp
  TypeFeedback.cpp
  )

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-variadic-macros -DLLVM_MAJOR=3 
-DLLVM_MINOR=0")
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]