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 Previous  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 Sep 26, 2007 11:18 am    Post subject: Reply with quote

Hi Kelly.
I know it's a bit late, but I have finally made a new commit. I have applied to things from your patches though I have rewritten it as some of it did not really work and/or was inconsistent to how I'm doing it elsewhere.

There are some breaking things in this release as it has been updated to work with LLVM rev 20070913, so upgrading LLVM is necessary. My Arch package is the one I'm using myself. Also Arch Linux recently updated from gc 6.8 to gc 7.0, this broke some things. Hopefully it will still work for people with less updated distros.

For all the details check the commit report on trac:
http://dsource.org/projects/llvmdc/changeset/10

I hope to have more goodies soon Smile Please post *any* feedback. It's the best motivation I can get.

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



Joined: 21 Apr 2006
Posts: 40

PostPosted: Wed Sep 26, 2007 12:08 pm    Post subject: Reply with quote

Hey Tomas,

Thanks for using anything I submitted, it helps my motivation, as well. Sorry it wasn't working perfectly (I actually realized that things for recursive classes weren't working completely but then I was going to try to fix it myself and surprise you.....I shouldn't do that since now we have both been working on similar things).

I was also working on some of the array stuff that it looks like you may have fixed. I will check the new llvmdc and see if my test cases pass now. I will keep you updated.

I will try to be more consistent with how you are doing things...I just don't understand the code well enough yet, I guess.

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 26, 2007 10:21 pm    Post subject: Reply with quote

Okay, not too long after committing and posting, I realized that I did some horrible testing on the structs-inside-structs thing. I've committed a fix for this and it seems to be working well now. The frontend was not very helpful but it's not too bad Smile

I think we should coordinate efforts to make sure there is no duplicated work. I've been looking into TypeInfo so that is most likely what I'll be doing mostly, but I'd also like to implement switch statements soon and probably start getting foreach to work.

Let me know if you (or anyone else) is working on specific features (or lack there of) so I won't waste time on that... Please don't hesitate to send patches Smile I promise to take a serious look at them when I have time.

I can imagine that the code is not that easy to get into. It could use a lot of refactoring - identifying patterns and making utility functions etc. Just ask if there is anything.

I'm usually on the D IRC channel if this place is too slow btw...

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



Joined: 21 Apr 2006
Posts: 40

PostPosted: Fri Oct 12, 2007 10:12 pm    Post subject: Reply with quote

Hey Tomas,

I was getting a couple errors when building the newest svn update from yesterday with llvm's 'svn update' from yesterday. I had errors in arrays.c and toir.c:

gen/arrays.c:153: warning: passing NULL to non-pointer argument 2 of ...

(Check out line 153 for more info because phpBB wouldn't allow me to post the full error message?!?). If you need a patch for this, I have one that just passes an llvm::constantPointerNull instead of the raw NULL.

Below is an error that I actually got for the last version of llvmdc as well as the current one. I fixed it with a new instance of an APFloat in a few spots.

gen/toir.c:2318: error:

(Once again check line 2318 because phpBB is freakin out Sad
I am getting a few casting assertions from inside llvm as well....are all tests supposed to pass (except some of the bug*.d test files, of course)?

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



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

PostPosted: Sat Oct 13, 2007 11:11 am    Post subject: Reply with quote

Hi Kelly.

I've been developing against the 2.1 release for a while now, so SVN is no longer needed (and I'm not testing against it), so I'd recommend you use 2.1 if you don't want to fix errors like this.

All tests should pass except typeinfo, throw1 and a few more. I'll take a look at the lines you mention...

I currently have some fairly big changes locally which I hope to have ready by tomorrow, then I'll be sure to include fixes if I find anything odd at those lines...

Glad to see you're still around Smile

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



Joined: 21 Apr 2006
Posts: 40

PostPosted: Sat Oct 13, 2007 2:46 pm    Post subject: Reply with quote

Hey Tomas,

Yeah, I should change to 2.1 it that is what you are using. I will keep a log of my changes for the svn version for later (just in case).

I haven't been around much, since I had some other interesting stuff to work on. I will try to get back into llvmdc soon, but I will be away for a week. I tried to reach you on #d but missed you last week....maybe next week Wink

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



Joined: 21 Apr 2006
Posts: 40

PostPosted: Fri Oct 26, 2007 1:26 am    Post subject: Reply with quote

Hey Tomas,

I updated things to llvm-2.1 and was able to build llvmdc without incident. The lphobos dir was a problem but I just needed a newer version of gdc. Ok, so everything compiles, including the runalltests.d and tester.d files. Cool.

Here is the output I am getting from runalltests (the end of it anyways):

6/140 of the tests failed to compile:
./v2d.d
./imports_2of2.d
./intrinsics.d
./bug26.d
./imports_1of2.d
./floatcmp.d
9/134 of the compiled tests failed to run:
./structs3.d
./dotproduct.d
./typeinfo2.d
./multiarr2.d
./structinit2.d
./arrays7.d
./arrays5.d
./funcptr.d
./throw1.d
125/140 of the tests passed

One or two problems are due to importing 'std.stdarg' instead of 'std.c.stdarg'...easily fixed. Some others are just failed assertions. The other problems are more serious, like llvm internal type mismatches. Remember this is on x86, only.

I only checked out dotproduct.d, so far, for the assert failure. It looks like the "const float f = 0.7071067811865474617f;" assignment is not assigning the float number....it is just assigning 0.0f!!! Here is the relevant output of the .ll file for the corresponding "vec3 v = vec3(f,f,0); vec3 w = vec3(f,0,f);" :

%tmp1 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 0 ; <float*> [#uses=1]
store float 0.000000e+00, float* %tmp1
%tmp2 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 1 ; <float*> [#uses=1]
store float 0.000000e+00, float* %tmp2
%tmp3 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 2 ; <float*> [#uses=1]
store float 0.000000e+00, float* %tmp3
%tmp4 = getelementptr %"10dotproduct4vec3"* %w, i32 0, i32 0 ; <float*> [#uses=1]
store float 0.000000e+00, float* %tmp4
%tmp5 = getelementptr %"10dotproduct4vec3"* %w, i32 0, i32 1 ; <float*> [#uses=1]
store float 0.000000e+00, float* %tmp5
%tmp6 = getelementptr %"10dotproduct4vec3"* %w, i32 0, i32 2 ; <float*> [#uses=1]
store float 0.000000e+00, float* %tmp6


Could be a size problem for floats on x86? I will look at these things tomorrow or on the weekend, if I can.

Talk later,
K.Wilson
Back to top
View user's profile Send private message
wilsonk



Joined: 21 Apr 2006
Posts: 40

PostPosted: Fri Oct 26, 2007 2:00 am    Post subject: Reply with quote

Doesn't seem to be a size problem with float. Just a problem with floats in general on the x86. If I change the code to all doubles then things look ok and the test runs.

Anyways, I will look closer later.

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



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

PostPosted: Fri Oct 26, 2007 6:54 am    Post subject: Reply with quote

Hi.

I just tried compiling the tests with -mx86, and the floats turn up fine here.
I'm not sure what the problem could be, but I would look inside RealExp::toElem and RealExp::toConstElem...

Use the -vv option for the excessive AST logging which may help you find the trouble spot(s).

I sure hope we can get this fixed. Eventually I will probably set up a 32bit chroot so I can test myself as well.

Good luck,

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



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

PostPosted: Fri Oct 26, 2007 7:35 am    Post subject: Reply with quote

I just had downs from IRC run the test suite. He is on 32 bit linux as well.

3/140 of the tests failed to compile: ./imports_1of2.d ./imports_2of2.d ./bug26.d
4/137 of the compiled tests failed to run: ./e.d ./v2d.d ./dotproduct.d ./throw1.d
133/140 of the tests passed

while dotproduct still fails, the ll he gets does have the correct constants. This issue is a bit weird :/
Back to top
View user's profile Send private message
wilsonk



Joined: 21 Apr 2006
Posts: 40

PostPosted: Sat Oct 27, 2007 12:58 am    Post subject: Reply with quote

Hey Tomas,

I just built llvmdc on a new x86-64 and it worked fine. Basically the same errors as above, except e.d and v2d.d are not errors. So there must be something wrong with my x86 setup, I guess.

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



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

PostPosted: Sat Oct 27, 2007 6:09 pm    Post subject: Reply with quote

Hi again.
I've committed a fix where calling struct and class methods did not always use the correct calling convention. This was causing floating point return values to be accessed incorrectly when sse optimization were enabled on x86. The bugs seen by downs should be fixed by this.

I would really have liked the calling convention to be attached to the function type, instead of the declaration and call site. Or at least just have module verification catch it. Most cases should be easy to check statically. Oh well...

Hope there is some progress on the "zero" problem.

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



Joined: 21 May 2004
Posts: 857

PostPosted: Mon Oct 29, 2007 2:16 pm    Post subject: Reply with quote

This is a very interesting D project and it looks like you have made good progress. Good luck!
Back to top
View user's profile Send private message AIM Address
gamerChad



Joined: 13 Aug 2005
Posts: 21
Location: Cydonia, Mars

PostPosted: Tue Oct 30, 2007 9:38 am    Post subject: Reply with quote

I noticed this project, then I noticed that LLVM has a C backend. That did it. I am now convinced that this may be one of the most important projects for my future use of D.

If this thing can be made, within the space of about 2-3 years, into a correct D compiler that outputs cross platform C code, then that would rock my world!

I'd like to contribute, though I have a couple reservations:
- I can't see any tickets in the ticket system, so I wouldn't know what needs doing.
- I get the feeling that this is all in C/C++, and also involves compiler theory. I am not great at either. Given that I am a college student with consistently difficult class load, I get this feeling I wouldn't be able to even learn the ropes fast enough to be useful.

Well, good luck with this!
Back to top
View user's profile Send private message
wilsonk



Joined: 21 Apr 2006
Posts: 40

PostPosted: Thu Nov 01, 2007 9:28 pm    Post subject: Reply with quote

Just so gamerChad knows, I have been able to transfer several bitcode files from my running x86-64 install of llvmdc over to my Sparc machine and compile them to C code. A simple 'gcc example.c' produces an executable that runs.

These are small examples but I will let people know if I can get some more significant examples compiled. Though, llvmdc must successfully compile larger examples first Wink

Thanks,
K.Wilson
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 Previous  1, 2, 3  Next
Page 2 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