FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

LLVM D Compiler
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic     Forum Index -> LDC
View previous topic :: View next topic  
Author Message
lindquist



Joined: 14 Sep 2006
Posts: 55
Location: Copenhagen, Denmark

PostPosted: Wed Aug 01, 2007 9:03 pm    Post subject: LLVM D Compiler Reply with quote

Hi.
I've been working on a LLVM D compiler for some time now, and I anticipate having a pre-alpha release ready in a week or two. I've decided that I'd like to host it on dsource for a nice Trac environment and all that.

The project should be called LLVMDC.

-Tomas Lindquist Olsen
Back to top
View user's profile Send private message
lindquist



Joined: 14 Sep 2006
Posts: 55
Location: Copenhagen, Denmark

PostPosted: Thu Aug 02, 2007 2:27 pm    Post subject: Reply with quote

Great Smile Thanx for this...

Link to Trac environment:
http://dsource.org/projects/llvmdc/wiki
Back to top
View user's profile Send private message
Anders



Joined: 24 Jun 2006
Posts: 1

PostPosted: Thu Aug 02, 2007 3:21 pm    Post subject: Reply with quote

Anders says hello! Very Happy
Back to top
View user's profile Send private message
mp4



Joined: 22 Jun 2007
Posts: 19

PostPosted: Sat Aug 11, 2007 4:41 am    Post subject: hi! Reply with quote

Hi! Just curious ... What do you expect from this compiler?
In what ways would it better than dmd or gdc?
Back to top
View user's profile Send private message
lindquist



Joined: 14 Sep 2006
Posts: 55
Location: Copenhagen, Denmark

PostPosted: Mon Aug 13, 2007 7:29 am    Post subject: Reply with quote

To start with it's not going to be better. In the long term however, I have faith that LLVM will evolve to become a leading backend in the compiler scene. Having a D compiler as early as possible will make sure any potential problems in LLVM can be solved before the project (LLVM) matures too much.

The LLVM optimizer is already pretty amazing. New architectures are being added as we speak, and the people behind it are very responsive to feedback and help requests.

But most importantly, I get myself a chance to learn something about compilers Smile So far it has been very interesting, and if I can actually create a working D 1.0 compiler as my first compiler project ever, I think that says a lot about LLVM as well. Even if the whole thing is mostly just a big hack.

-Tomas
Back to top
View user's profile Send private message
yukito



Joined: 22 Aug 2006
Posts: 2
Location: Belgium

PostPosted: Fri Aug 31, 2007 4:01 am    Post subject: Re: hi! Reply with quote

mp4 wrote:
Hi! Just curious ... What do you expect from this compiler?
In what ways would it better than dmd or gdc?


Some of us just like LLVM and would like to see D work on their amazing backend. LLVM was designed to support many advanced languages, so it's only natural that we want D on it.

Keep up the good work, lindquist!
Back to top
View user's profile Send private message MSN Messenger
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Fri Aug 31, 2007 11:14 am    Post subject: Reply with quote

Yeah, LLVM is quite amazing. I'd be somewhat surprised if it doesn't generate tighter code than dmd
Back to top
View user's profile Send private message
lindquist



Joined: 14 Sep 2006
Posts: 55
Location: Copenhagen, Denmark

PostPosted: Sat Sep 01, 2007 1:51 pm    Post subject: Reply with quote

I have committed the code to trunk now. It requires LLVM from svn. I have been developing against revision 20070821.

Please note that this is not a complete D compiler. Many things are still not working.

Arch linux users can get my llvm-svn package from AUR.
You will need premake to generate the Makefile, and I've only tested on x86-64 linux, there may be problems on other platforms.

Any feedback is much appreciated Smile

The code is pretty rough... Bear with me it's my first compiler Smile

-Tomas
Back to top
View user's profile Send private message
wilsonk



Joined: 21 Apr 2006
Posts: 40

PostPosted: Sun Sep 02, 2007 3:00 pm    Post subject: llvmdc Reply with quote

Hey Tomas,

This is great stuff. I just compiled everything using llvm's svn repo for today. Everything works and I love the little build.sh/tester.sh, etc. scripts to help things along. I will mention for others that they need premake (google for it) in their path. Then just do a 'premake --target gnu' under linux to get things moving Wink

Are all of the test directories files supposed to work? I assume not since I am getting several errors. Some files work though.

How are you calculating uses? Do you have an SSA intermediate form that I can't see? Just wondering since I think the struct 's' in ...test/b.d has 8 uses, I believe, instead of the 9 in the llvm output code. Not a disparaging remark here at all.....just wondering Wink

This is really great stuff....wooohoooo.

Thanks,
K.Wilson

P.S. I had never used premake but it is a great little program.
Back to top
View user's profile Send private message
lindquist



Joined: 14 Sep 2006
Posts: 55
Location: Copenhagen, Denmark

PostPosted: Sun Sep 02, 2007 3:43 pm    Post subject: Reply with quote

Thanx for trying it out wilsonk Smile
The .ll you see is generated by the external llvm-dis tool so llvmdc really has nothing to do with the uses thing.
Basically llvm just generates bytecode and (optionally) passes it on to llvm-ld for optimization and linking.

Most of the files in test should work. I'll try them out and see what I broke Smile the type info stuff there is really the only ones that shouldn't work yet. I'm still working on TypeInfo.

-Tomas
Back to top
View user's profile Send private message
wilsonk



Joined: 21 Apr 2006
Posts: 40

PostPosted: Sun Sep 02, 2007 3:53 pm    Post subject: Reply with quote

Ahh,

Sorry Tomas, I didn't realise that llvm-dis is generating the .ll output...this would seem to indicate that llvm is internally setting up its SSA intermediate form once it gets your input. Makes sense, and makes a different project I was looking at much easier...haha cool.

I haven't looked at your code much yet. I just had to post something, though, to let you know that at least one other person has it running and is looking at it.

Thanks,
K.Wilson
Back to top
View user's profile Send private message
lindquist



Joined: 14 Sep 2006
Posts: 55
Location: Copenhagen, Denmark

PostPosted: Tue Sep 04, 2007 11:19 pm    Post subject: Reply with quote

I've been doing some small fixes. Now all tests should work except the one or two that use typeinfo.
I've also added a preliminary rebuild profile and a small readme.
Back to top
View user's profile Send private message
wilsonk



Joined: 21 Apr 2006
Posts: 40

PostPosted: Wed Sep 12, 2007 2:11 am    Post subject: Reply with quote

Hey Tomas,

I have a couple diffs for you. They are a couple fixes for recursive functions and dynamic arrays. There are a couple test files included in this tgz:

http://pages.cpsc.ucalgary.ca/~wilsonk/llvmdc.tgz

Let me know if something is missing or improperly done.

Thanks,
K.Wilson
Back to top
View user's profile Send private message
lindquist



Joined: 14 Sep 2006
Posts: 55
Location: Copenhagen, Denmark

PostPosted: Wed Sep 12, 2007 10:48 am    Post subject: Reply with quote

Hey Smile
Glad to see you're looking at it... Could I get you to post the diffs as unified? or just use 'svn diff'.

Please let me know if you'd like to collaborate more as I could certainly use some help.

-Tomas
Back to top
View user's profile Send private message
wilsonk



Joined: 21 Apr 2006
Posts: 40

PostPosted: Wed Sep 12, 2007 7:36 pm    Post subject: Reply with quote

Hey Tomas,

I would try to do the 'svn diff', as usual, but I have monkeyed around with the code base so much at this point that the diff is monstrous (and useless as a result). I was actually hoping that I could download a new copy once the diffs I posted were applied and stop messing up the code so much. I have a better idea of how things are working now.

I had saved a copy of llvmdc before I messed things up at all, but then I did an svn update without thinking and my backup copy was revision 8 instead of 9...this meant another monstrous diff which would include all of your diffs anyways.

I will try not to do this again. Sorry. If you really need me to get a unified diff I can try it with just those three files, I guess. Obviously the two test case files can just be copied to .../llvmdc/test.

Thanks,
K.Wilson

P.S. I would like to collaborate more (but I may be starting a new job soon so I will have to see how much time I have). I should have time over the next couple weeks, at least Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> LDC All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group