[LLVMdev] ldc (LLVM backend for the D Programming Language) has x86-64 support

Kelly W wilsonkk at shaw.ca
Mon Oct 27 23:03:40 PDT 2008

Hello everyone,


I just thought I would let people here know that ldc (llvm backend for the D
Programming Language) is getting pretty usable (a few larger libraries
compile) and it now has x86-64 support added. I decided to run some timings
on some D and C++ code to compare ldc to dmd (the mainline compiler), gdc
(the gcc based D compiler) and g++. I used a ray tracing program found in
this thread (make sure to use the code mentioned later in the thread as it
has some optimizations):


Go to digitalmars.com/ webnews/ newsgroups.php?renew=1 and search for:  "D
slower than C++ by a factor of _two_ for simple raytracer (gdc)"


There are versions of the tracer for D and C++ that are quite comparable.
Here are some timings I got on an AMDx86-64 running Fedora Core Linux.
Timings are averaged over 6 runs.


llvm-g++4.0.1   5.76   (build 5449..backend from svn today)
ldc-rev736      6.68
g++4.1.2        6.72
gdc0.24         7.45
g++4.3.1        7.66
dmd1.030        14.52


As you can see D is NOT that much slower for the ray tracer, when using the
proper compiler and options ;)  Dmd doesn't optimize very well here.


I think LLVM performs quite admirably here and I am glad ldc uses it for a
backend. The thread mentions the optimizations used for each compiler (ldc
uses the same options as dmd).


Just thought I would let people know,



P.S. I am not sure if this counts as another "supported language" for LLVM
yet, but I think it is getting close.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081028/66d654de/attachment.html>

More information about the llvm-dev mailing list