[LLVMdev] Testing LLVM on OS X

Patrick Flanagan patrick at valtrain.com
Fri Apr 30 18:25:01 PDT 2004


>
> There are two problems with this: 1) there is no JIT for PPC yet, so
> LLVM will use the interpreter (which is intolerably slow and has other
> issues).   2) Spec compiles the executables in one place and them moves
> them to another, but it only copies the shell script and not the
> bytecode file, so you get that error message.
>
> The normal solution to this problem is to link with the llvmgcc
> '-Wl,-native' option.  This tells llvmgcc to produce a native executable
> instead of a shell script, using a PPC backend.  I'm sure you immediately
> see the problem with this.  :)
>
> The real solution to your problem is in CVS.  There llvmgcc supports a
> -Wl,-native-cbe option which will use the C backend to create a native
> executable for you, and can actually be used to run SPEC successfully.
> If you're willing to grab LLVM CVS (details here:
> http://llvm.cs.uiuc.edu/docs/GettingStarted.html#checkout ), this is the
> best bet.

Thanks! Grabbed the latest from CVS and added that linker option to the
config file. It looks like it compiles and runs the SPEC tests ok now. Just
to make sure I understand how LLVM works, got a few clarifications:

1. The ppc code I'm generating with the -native-cbe is static, correct?
2. Is there a frontend to any of the other gnu compiler collection stuff? Eg
g77 or something for compiling fortran code or is c/c++ the focus right now?
3. Does the code that uses the JIT compiler (I know, doesn't currently exist
on ppc) currently take advantage of run-time optimization? If I ran the SPEC
suite with a JIT compiled version several times, would I except the score to
eventually increase at all, depending on what the benchmark does?


> > Is anyone currently working on making it generate native ppc code for OS
> > X? If not, what would be involved in doing so? I'm new to LLVM, I'd
> > appreciate some pointers to some info that might shed some light on
> > that.
>
> There was a group that started working on this, but I believe they got
> stalled and are no longer working on it.  It will try to get in touch with
> them to see where things stand, then get back to you on this.
>

I only know just enough about compilers to be dangerous, but I'm working on
learning more :). If no one else is currently working on this, what would be
needed in order to get the JIT compiler up and running on ppc/os x? Is it
just a matter of taking some tree/rtl form stuff and emitting ppc code
instead of x86 code? Is there code that needs to be ported to os x so it can
profile itself?

Patrick





More information about the llvm-dev mailing list