digitalmars.D - LLVM
- Craig Black (10/10) Nov 20 2006 LLVM (http://llvm.org/) is a backend for compilers. It is portable to m...
- Gregor Richards (4/18) Nov 20 2006 I have tried it with LLVM's GCC and GDC. It didn't work out-of-the-box,...
- Craig Black (5/8) Nov 20 2006 How long ago did you try this? LLVM just released a new 1.9 version tha...
- Charlie (3/16) Nov 20 2006 A third D compiler would be very cool, especially if its around when D
- Gregor Richards (4/22) Nov 20 2006 LLVM uses GCC, so in all fairness it would hardly be a third D compiler,...
- Charlie (10/34) Nov 20 2006 Hmm, I don't think it uses GCC as a backend.
- Wayne (6/40) Nov 20 2006 Take a look at
- Gregor Richards (13/53) Nov 20 2006 )top-post don't please(
- Wolfgang Draxinger (8/10) Nov 20 2006 I already mentioned my attempts on a D ABI for which I planned to
- Craig Black (2/3) Nov 20 2006 Excellent! I'm very curious about performance comparisons. Keep us pos...
- jcc7 (6/9) Nov 20 2006 Someone has looked into doing this a couple years ago. I don't know if h...
- Lionello Lunesu (4/4) Nov 20 2006 Great idea!
- Craig Black (4/8) Nov 20 2006 Good point. Perhaps someone could suggest that they add one.
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (3/7) Nov 20 2006 Just use the "double" type, that is what PowerPC does anyway...
- Craig Black (2/2) Nov 20 2006 64 bit doubles are sufficient for most applications, but not all.
- Walter Bright (5/6) Nov 20 2006 If the underlying hardware does not support extended real types, then it...
- Wolfgang Draxinger (8/12) Nov 20 2006 Cool. A few weeks ago I wondered why there is not (well there is,
- John Reimer (6/21) Nov 20 2006 I like this idea! I'm not sure how difficult it would be to include a D ...
- Chad J (20/34) Nov 20 2006 Hmmm... looks like they are working on an ARM backend. This could be
- John Reimer (6/36) Nov 20 2006 I'm wondering if Walter will have the same source "tainting" issue with ...
- Gregor Richards (4/52) Nov 20 2006 I have now posted this at least three times.
- John Reimer (28/35) Nov 20 2006 Yes, I've seen your posts. But it's unclear despite the nice little grap...
- Walter Bright (9/11) Nov 20 2006 Yes, since it is copyrighted. However, I *can* read documentation about
- Paolo Invernizzi (12/26) Nov 21 2006 I've played with LLVM and D, one yr ago, submitting patches to LLVM for
LLVM (http://llvm.org/) is a backend for compilers. It is portable to many platforms, well documened, and actively developed. It seems that they are making great progress with it. A crazy idea. Has anyone considered using LLVM with D's front end? I know Walter has his own back end, but it's seems hard for one guy to maintain both a front and back end, and do a good job at both. Even a programming god like Walter. If we had the LLVM team actively developing and innovating the back end, then Walter could focus on innovating the front end and the D language. Just a thought. -Craig
Nov 20 2006
Craig Black wrote:LLVM (http://llvm.org/) is a backend for compilers. It is portable to many platforms, well documened, and actively developed. It seems that they are making great progress with it. A crazy idea. Has anyone considered using LLVM with D's front end? I know Walter has his own back end, but it's seems hard for one guy to maintain both a front and back end, and do a good job at both. Even a programming god like Walter. If we had the LLVM team actively developing and innovating the back end, then Walter could focus on innovating the front end and the D language. Just a thought. -CraigI have tried it with LLVM's GCC and GDC. It didn't work out-of-the-box, but I don't think it would take a whole lot of hackery. - Gregor Richards
Nov 20 2006
I have tried it with LLVM's GCC and GDC. It didn't work out-of-the-box, but I don't think it would take a whole lot of hackery. - Gregor RichardsHow long ago did you try this? LLVM just released a new 1.9 version that they claim is way better. I'm not sure what you mean by out-of-the-box. But, like you say, I don't think it would be a massive effort. It seems that LLVM is pretty well thought out. -Craig
Nov 20 2006
A third D compiler would be very cool, especially if its around when D goes 1.0. Craig Black wrote:I have tried it with LLVM's GCC and GDC. It didn't work out-of-the-box, but I don't think it would take a whole lot of hackery. - Gregor RichardsHow long ago did you try this? LLVM just released a new 1.9 version that they claim is way better. I'm not sure what you mean by out-of-the-box. But, like you say, I don't think it would be a massive effort. It seems that LLVM is pretty well thought out. -Craig
Nov 20 2006
Charlie wrote:A third D compiler would be very cool, especially if its around when D goes 1.0. Craig Black wrote:LLVM uses GCC, so in all fairness it would hardly be a third D compiler, it would just be another face of GDC. - Gregor RichardsI have tried it with LLVM's GCC and GDC. It didn't work out-of-the-box, but I don't think it would take a whole lot of hackery. - Gregor RichardsHow long ago did you try this? LLVM just released a new 1.9 version that they claim is way better. I'm not sure what you mean by out-of-the-box. But, like you say, I don't think it would be a massive effort. It seems that LLVM is pretty well thought out. -Craig
Nov 20 2006
Hmm, I don't think it uses GCC as a backend. From the website: We find that LLVM is able to compile C++ into substantially better code than GCC . It says it can use the GCC front-end for its LLVM backend, which I think is the opposite of GDC, which uses DMD front end to produce a tree usable by GCC backend. I think DMD Frontend translated to LLVM backend would be completely independent of GCC, and the more compilers the better! Charlie Gregor Richards wrote:Charlie wrote:A third D compiler would be very cool, especially if its around when D goes 1.0. Craig Black wrote:LLVM uses GCC, so in all fairness it would hardly be a third D compiler, it would just be another face of GDC. - Gregor RichardsI have tried it with LLVM's GCC and GDC. It didn't work out-of-the-box, but I don't think it would take a whole lot of hackery. - Gregor RichardsHow long ago did you try this? LLVM just released a new 1.9 version that they claim is way better. I'm not sure what you mean by out-of-the-box. But, like you say, I don't think it would be a massive effort. It seems that LLVM is pretty well thought out. -Craig
Nov 20 2006
Take a look at http://llvm.org/pubs/2006-04-25-GelatoLLVMIntro.pdf LLVM optionally uses GCC as a front end for C/C++ FORTRAN ADA and Java. It looks like the existing DMD front end could be adapted to LLVM Wayne Charlie Wrote:Hmm, I don't think it uses GCC as a backend. From the website: We find that LLVM is able to compile C++ into substantially better code than GCC . It says it can use the GCC front-end for its LLVM backend, which I think is the opposite of GDC, which uses DMD front end to produce a tree usable by GCC backend. I think DMD Frontend translated to LLVM backend would be completely independent of GCC, and the more compilers the better! Charlie Gregor Richards wrote:Charlie wrote:A third D compiler would be very cool, especially if its around when D goes 1.0. Craig Black wrote:LLVM uses GCC, so in all fairness it would hardly be a third D compiler, it would just be another face of GDC. - Gregor RichardsI have tried it with LLVM's GCC and GDC. It didn't work out-of-the-box, but I don't think it would take a whole lot of hackery. - Gregor RichardsHow long ago did you try this? LLVM just released a new 1.9 version that they claim is way better. I'm not sure what you mean by out-of-the-box. But, like you say, I don't think it would be a massive effort. It seems that LLVM is pretty well thought out. -Craig
Nov 20 2006
Charlie wrote:Gregor Richards wrote:)top-post don't please( Normal GCC (simplified): [C] code -> GIMPLE -> target ASM LLVM GCC (simplified): [C] code -> GIMPLE -> LLVM ASM Normal GDC (simplified); D code -> GIMPLE -> target ASM LLVM GDC (simplified): D code -> GIMPLE -> LLVM ASM The same component of GCC (namely, the IR, GIMPLE) is both a backend to GDC and a frontend to LLVM. - Gregor RichardsCharlie wrote:Hmm, I don't think it uses GCC as a backend. From the website: We find that LLVM is able to compile C++ into substantially better code than GCC . It says it can use the GCC front-end for its LLVM backend, which I think is the opposite of GDC, which uses DMD front end to produce a tree usable by GCC backend. I think DMD Frontend translated to LLVM backend would be completely independent of GCC, and the more compilers the better! CharlieA third D compiler would be very cool, especially if its around when D goes 1.0. Craig Black wrote:LLVM uses GCC, so in all fairness it would hardly be a third D compiler, it would just be another face of GDC. - Gregor RichardsI have tried it with LLVM's GCC and GDC. It didn't work out-of-the-box, but I don't think it would take a whole lot of hackery. - Gregor RichardsHow long ago did you try this? LLVM just released a new 1.9 version that they claim is way better. I'm not sure what you mean by out-of-the-box. But, like you say, I don't think it would be a massive effort. It seems that LLVM is pretty well thought out. -Craig
Nov 20 2006
Charlie wrote:A third D compiler would be very cool, especially if its around when D goes 1.0.I already mentioned my attempts on a D ABI for which I planned to fork GDC. I think, this is the perfect moment to get my LLVM based D compiler started. So in 3 words: I'm on it! Wolfgang Draxinger -- E-Mail address works, Jabber: hexarith jabber.org, ICQ: 134682867
Nov 20 2006
I'm on it!Excellent! I'm very curious about performance comparisons. Keep us posted! -Craig
Nov 20 2006
== Quote from Craig Black (cblack ara.com)'s articleLLVM (http://llvm.org/) is a backend for compilers. It is portable to many platforms, well documened, and actively developed. It seems that > theyare making great progress with it.A crazy idea. Has anyone considered using LLVM with D's front end?Someone has looked into doing this a couple years ago. I don't know if he ran into a serious problem (or perhaps just lost interest in the idea), but I'm guessing he never finished his project: http://www.digitalmars.com/d/archives/D/gnu/762.html
Nov 20 2006
Great idea! I just noticed however that their IR language has no "real" (long double) float representation? L.
Nov 20 2006
"Lionello Lunesu" <lionello lunesu.remove.com> wrote in message news:ejt4m7$2o18$1 digitaldaemon.com...Great idea! I just noticed however that their IR language has no "real" (long double) float representation? L.Good point. Perhaps someone could suggest that they add one. -Craig
Nov 20 2006
Craig Black wrote:Just use the "double" type, that is what PowerPC does anyway... --andersI just noticed however that their IR language has no "real" (long double) float representation?Good point. Perhaps someone could suggest that they add one.
Nov 20 2006
64 bit doubles are sufficient for most applications, but not all. -Craig
Nov 20 2006
Craig Black wrote:64 bit doubles are sufficient for most applications, but not all.If the underlying hardware does not support extended real types, then it is reasonable for a D compiler to treat them as doubles. If the hardware does support extended real, then for a D compiler to not support it, well, I'd call that not a proper D implementation.
Nov 20 2006
Craig Black wrote:LLVM (http://llvm.org/) is a backend for compilers. It is portable to many platforms, well documened, and actively developed. It seems that they are making great progress with it.Cool. A few weeks ago I wondered why there is not (well there is, but I wasn't aware of it) a comiler suite, where each step of the compilation process can be individually controlled. Now I know about LLVM. Thanks. Wolfgang Draxinger -- E-Mail address works, Jabber: hexarith jabber.org, ICQ: 134682867
Nov 20 2006
On Mon, 20 Nov 2006 10:56:53 -0800, Craig Black <cblack ara.com> wrote:LLVM (http://llvm.org/) is a backend for compilers. It is portable to many platforms, well documened, and actively developed. It seems that they are making great progress with it. A crazy idea. Has anyone considered using LLVM with D's front end? I know Walter has his own back end, but it's seems hard for one guy to maintain both a front and back end, and do a good job at both. Even a programming god like Walter. If we had the LLVM team actively developing and innovating the back end, then Walter could focus on innovating the front end and the D language. Just a thought. -CraigI like this idea! I'm not sure how difficult it would be to include a D frontend with the default distribution (in the way that several gcc frontends seem to be included), but the licensing certainly appears to be quite accommodating. -JJR
Nov 20 2006
Craig Black wrote:LLVM (http://llvm.org/) is a backend for compilers. It is portable to many platforms, well documened, and actively developed. It seems that they are making great progress with it. A crazy idea. Has anyone considered using LLVM with D's front end? I know Walter has his own back end, but it's seems hard for one guy to maintain both a front and back end, and do a good job at both. Even a programming god like Walter. If we had the LLVM team actively developing and innovating the back end, then Walter could focus on innovating the front end and the D language. Just a thought. -CraigHmmm... looks like they are working on an ARM backend. This could be nice. If they get that ARM backend done by say, summer of next year, and the D front-end is plugged in, then I might be willing to take a crack at making ARM work on that one in addition to GDC. Then I could decide which one is nicer to work with and focus on that. Kind of a longshot though (they'd need wince support too). Admittedly the current arm-wince-pe GDC I put together has some uh ...annoyances... and I've no idea how to solve them. Now I wonder, is Walter really maintaining the backend much? I thought that part of dmd was pretty solid already and he is just focusing on the front-end and other D affairs. What would impress me is if the main development of D would occur on this LLVM compiler, or at least be readily portable to it within hours or a few days (this assumes LLVM is a good quality backend that Walter wouldn't mind switching to). The utility I am looking for there is having a bleeding-edge D compiler that is also very retargetable, and doesn't require big man-hours to be maintained as it seems gdc does. DMD is great on windows, but it is fairly useless on my pda since, well, it doesn't even generate code for that at all!
Nov 20 2006
On Mon, 20 Nov 2006 13:41:28 -0800, Chad J <gamerChad _spamIsBad_gmail.com> wrote:Craig Black wrote:I'm wondering if Walter will have the same source "tainting" issue with LLVM as he did for gcc. I wish not because it would be much better if the reference compiler development could continue on a completely open system. -JJRLLVM (http://llvm.org/) is a backend for compilers. It is portable to many platforms, well documened, and actively developed. It seems that they are making great progress with it. A crazy idea. Has anyone considered using LLVM with D's front end? I know Walter has his own back end, but it's seems hard for one guy to maintain both a front and back end, and do a good job at both. Even a programming god like Walter. If we had the LLVM team actively developing and innovating the back end, then Walter could focus on innovating the front end and the D language. Just a thought. -CraigHmmm... looks like they are working on an ARM backend. This could be nice. If they get that ARM backend done by say, summer of next year, and the D front-end is plugged in, then I might be willing to take a crack at making ARM work on that one in addition to GDC. Then I could decide which one is nicer to work with and focus on that. Kind of a longshot though (they'd need wince support too). Admittedly the current arm-wince-pe GDC I put together has some uh ...annoyances... and I've no idea how to solve them. Now I wonder, is Walter really maintaining the backend much? I thought that part of dmd was pretty solid already and he is just focusing on the front-end and other D affairs. What would impress me is if the main development of D would occur on this LLVM compiler, or at least be readily portable to it within hours or a few days (this assumes LLVM is a good quality backend that Walter wouldn't mind switching to). The utility I am looking for there is having a bleeding-edge D compiler that is also very retargetable, and doesn't require big man-hours to be maintained as it seems gdc does. DMD is great on windows, but it is fairly useless on my pda since, well, it doesn't even generate code for that at all!
Nov 20 2006
John Reimer wrote:On Mon, 20 Nov 2006 13:41:28 -0800, Chad J <gamerChad _spamIsBad_gmail.com> wrote:I have now posted this at least three times. LLVM's compiler is GCC. - Gregor RichardsCraig Black wrote:I'm wondering if Walter will have the same source "tainting" issue with LLVM as he did for gcc. I wish not because it would be much better if the reference compiler development could continue on a completely open system. -JJRLLVM (http://llvm.org/) is a backend for compilers. It is portable to many platforms, well documened, and actively developed. It seems that they are making great progress with it. A crazy idea. Has anyone considered using LLVM with D's front end? I know Walter has his own back end, but it's seems hard for one guy to maintain both a front and back end, and do a good job at both. Even a programming god like Walter. If we had the LLVM team actively developing and innovating the back end, then Walter could focus on innovating the front end and the D language. Just a thought. -CraigHmmm... looks like they are working on an ARM backend. This could be nice. If they get that ARM backend done by say, summer of next year, and the D front-end is plugged in, then I might be willing to take a crack at making ARM work on that one in addition to GDC. Then I could decide which one is nicer to work with and focus on that. Kind of a longshot though (they'd need wince support too). Admittedly the current arm-wince-pe GDC I put together has some uh ...annoyances... and I've no idea how to solve them. Now I wonder, is Walter really maintaining the backend much? I thought that part of dmd was pretty solid already and he is just focusing on the front-end and other D affairs. What would impress me is if the main development of D would occur on this LLVM compiler, or at least be readily portable to it within hours or a few days (this assumes LLVM is a good quality backend that Walter wouldn't mind switching to). The utility I am looking for there is having a bleeding-edge D compiler that is also very retargetable, and doesn't require big man-hours to be maintained as it seems gdc does. DMD is great on windows, but it is fairly useless on my pda since, well, it doesn't even generate code for that at all!
Nov 20 2006
On Mon, 20 Nov 2006 14:37:23 -0800, Gregor Richards <Richards codu.org> wrote:Yes, I've seen your posts. But it's unclear despite the nice little graph that you posted for us to consider. Quoting the site: "LLVM is also a collection of source code that implements the language and compilation strategy. The primary components of the LLVM infrastructure are a GCC-based C & C++ front-end, a link-time optimization framework with a growing set of global and interprocedural analyses and transformations, static back-ends for the X86, PowerPC, IA-64, Alpha and SPARC architectures, a back-end which emits portable C code, and a Just-In-Time compiler for X86 and PowerPC processors." My question is why do they say the the LLVM infrastructure uses the GCC-based /C & C++ front-end/? The backends are not GCC... I guess this is just depends how far back the backend is :)? (Oh wait... GIMPLE is a frontend for the virtual machine) You mentioned GIMPLE as being used for the IR (Intermediate Representation) which GDC uses to interface with the GCC backend. It's still a little unlcear to me, so have patience. 1) Is GIMPLE a problem for use here? (License-wise) 2) If GIMPLE is the IR, this means that GDC already has all that's necessary to attach to LLVM? 3) Whatever the case, including a GDC front end with LLVM may be easier than doing so with FSF. FSF seems to want complete ownership of the D frontend before they will accept it into the fold of gcc. Not sure how the LLVM group will act in this matter, but there licensing method seems quite different. -JJRwith LLVM as he did for gcc. I wish not because it would be much better if the reference compiler development could continue on a completely open system. -JJRI have now posted this at least three times. LLVM's compiler is GCC. - Gregor Richards
Nov 20 2006
John Reimer wrote:I'm wondering if Walter will have the same source "tainting" issue with LLVM as he did for gcc.Yes, since it is copyrighted. However, I *can* read documentation about the compiler (one cannot copyright an idea, ideas are covered by patent law, not copyrights). Aside from working with the LLVM source, I am happy to help out in any way I can those who want to integrated the D front end with LLVM. One advantage LLVM has over gcc is that gcc is reluctant to include gdc as part of the default gcc distribution. If LLVM is willing to include D with their main distribution, that would be very good for D users.
Nov 20 2006
I've played with LLVM and D, one yr ago, submitting patches to LLVM for VC7 compilation of the LLVM backend, just to try to do a backend for DMD frontend on Windows. So, as seems that everybody is playing with the frontend, it's not time to have it in a svn repository on DigitalMars/somewhere? We are all applying the same patches, merging subsequent Walter release, adding headers, and so on... Can't we work on the same codebase? At least Walter and David Friedman! Just my 2c.... --- Paolo Invernizzi Walter Bright wrote:John Reimer wrote:I'm wondering if Walter will have the same source "tainting" issue with LLVM as he did for gcc.Yes, since it is copyrighted. However, I *can* read documentation about the compiler (one cannot copyright an idea, ideas are covered by patent law, not copyrights). Aside from working with the LLVM source, I am happy to help out in any way I can those who want to integrated the D front end with LLVM. One advantage LLVM has over gcc is that gcc is reluctant to include gdc as part of the default gcc distribution. If LLVM is willing to include D with their main distribution, that would be very good for D users.
Nov 21 2006