JIT + tail cals

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

JIT + tail cals

Alexander Friedman
How do I tell the code generator to enable tail calls on the X86?
Since it is part of a library, I cannot pass a command line argument.

--


-Alex

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: JIT + tail cals

Alexander Friedman
On May 18, Alexander Friedman wrote:
> How do I tell the code generator to enable tail calls on the X86?
> Since it is part of a library, I cannot pass a command line argument.

Of course I *can* call cl::ParseCommandLineOptions, but maybe there
should be something more straitforward than that?

--


-Alex

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: JIT + tail cals

Morten Ofstad
In reply to this post by Alexander Friedman
Alexander Friedman wrote:
> How do I tell the code generator to enable tail calls on the X86?
> Since it is part of a library, I cannot pass a command line argument.

Here is a snippet from our code which might help you ;-)

   const char *args[] = { "-disable-pattern-isel", "false", 0 };
   cl::ParseCommandLineOptions(2, args);

m.

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: JIT + tail cals

Chris Lattner
On Wed, 18 May 2005, Morten Ofstad wrote:
> Alexander Friedman wrote:
>> How do I tell the code generator to enable tail calls on the X86?
>> Since it is part of a library, I cannot pass a command line argument.
>
> Here is a snippet from our code which might help you ;-)
>
>  const char *args[] = { "-disable-pattern-isel", "false", 0 };
>  cl::ParseCommandLineOptions(2, args);

Yup, something like this should work.  Two comments though:

1. Morton, the pattern isel is now on by default for X86, and that option
    doesn't exist.  If you update to CVS you can remove that.  Using
    -enable-x86-fastcc should work with CVS though.
2. I haven't done much testing with the JIT and tail calls.  I wouldn't be
    suprised if there are minor issues that need to be fixed.  I will try
    to take a look and see what remains to be done over the next couple of
    days.

-Chris

--
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: JIT + tail cals

Chris Lattner
On Wed, 18 May 2005, Chris Lattner wrote:
> Yup, something like this should work.  Two comments though:
> 2. I haven't done much testing with the JIT and tail calls.  I wouldn't be
>   suprised if there are minor issues that need to be fixed.  I will try
>   to take a look and see what remains to be done over the next couple of
>   days.

As I expected, there were issues.  I fixed the following two problems:

1. The JIT didn't know where a call came from when it was a tail call (jmp
    doesn't push a return address).
2. The JIT was clobbering EAX/EDX when lazily compiling a function, and
    X86 fastcc wants to pass values in those registers.

I think things are working now, give it a spin and lemme know if you hit
any problems.

-Chris

--
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: JIT + tail cals

Jeff Cohen
Chris Lattner wrote:

> On Wed, 18 May 2005, Chris Lattner wrote:
>
>> Yup, something like this should work.  Two comments though:
>> 2. I haven't done much testing with the JIT and tail calls.  I
>> wouldn't be
>>   suprised if there are minor issues that need to be fixed.  I will try
>>   to take a look and see what remains to be done over the next couple of
>>   days.
>
>
> As I expected, there were issues.  I fixed the following two problems:
>
> 1. The JIT didn't know where a call came from when it was a tail call
> (jmp
>    doesn't push a return address).
> 2. The JIT was clobbering EAX/EDX when lazily compiling a function, and
>    X86 fastcc wants to pass values in those registers.
>
> I think things are working now, give it a spin and lemme know if you
> hit any problems.
>
> -Chris
>
VC++ build is broken as a result of this change.  I'll get it fixed soon.

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: JIT + tail cals

Jeff Cohen
VC++ builds are working again.

However, llvm-test is broken.  The configured makefile is bad:

# Path to the boxed-sim source code
@USE_BOXEDSIM@
BOXEDSIM_ROOT := @BOXEDSIM_ROOT@


Jeff Cohen wrote:

> Chris Lattner wrote:
>
>> On Wed, 18 May 2005, Chris Lattner wrote:
>>
>>> Yup, something like this should work.  Two comments though:
>>> 2. I haven't done much testing with the JIT and tail calls.  I
>>> wouldn't be
>>>   suprised if there are minor issues that need to be fixed.  I will try
>>>   to take a look and see what remains to be done over the next
>>> couple of
>>>   days.
>>
>>
>>
>> As I expected, there were issues.  I fixed the following two problems:
>>
>> 1. The JIT didn't know where a call came from when it was a tail call
>> (jmp
>>    doesn't push a return address).
>> 2. The JIT was clobbering EAX/EDX when lazily compiling a function, and
>>    X86 fastcc wants to pass values in those registers.
>>
>> I think things are working now, give it a spin and lemme know if you
>> hit any problems.
>>
>> -Chris
>>
> VC++ build is broken as a result of this change.  I'll get it fixed soon.
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: JIT + tail cals

Reid Spencer
Boxedsim was nuked just before the 1.5 release. It was buggy and we
never got it working. Chances are your llvm-test tree is out of date?

Reid.

On Thu, 2005-05-19 at 18:39 -0700, Jeff Cohen wrote:

> VC++ builds are working again.
>
> However, llvm-test is broken.  The configured makefile is bad:
>
> # Path to the boxed-sim source code
> @USE_BOXEDSIM@
> BOXEDSIM_ROOT := @BOXEDSIM_ROOT@
>
>
> Jeff Cohen wrote:
>
> > Chris Lattner wrote:
> >
> >> On Wed, 18 May 2005, Chris Lattner wrote:
> >>
> >>> Yup, something like this should work.  Two comments though:
> >>> 2. I haven't done much testing with the JIT and tail calls.  I
> >>> wouldn't be
> >>>   suprised if there are minor issues that need to be fixed.  I will try
> >>>   to take a look and see what remains to be done over the next
> >>> couple of
> >>>   days.
> >>
> >>
> >>
> >> As I expected, there were issues.  I fixed the following two problems:
> >>
> >> 1. The JIT didn't know where a call came from when it was a tail call
> >> (jmp
> >>    doesn't push a return address).
> >> 2. The JIT was clobbering EAX/EDX when lazily compiling a function, and
> >>    X86 fastcc wants to pass values in those registers.
> >>
> >> I think things are working now, give it a spin and lemme know if you
> >> hit any problems.
> >>
> >> -Chris
> >>
> > VC++ build is broken as a result of this change.  I'll get it fixed soon.
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > [hidden email]         http://llvm.cs.uiuc.edu
> > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
> >
> >
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JIT + tail cals

Chris Lattner
In reply to this post by Jeff Cohen
On Thu, 19 May 2005, Jeff Cohen wrote:
> VC++ builds are working again.
> However, llvm-test is broken.  The configured makefile is bad:

Fixed.  Thanks Jeff,

-Chris

> Jeff Cohen wrote:
>
>> Chris Lattner wrote:
>>
>>> On Wed, 18 May 2005, Chris Lattner wrote:
>>>
>>>> Yup, something like this should work.  Two comments though:
>>>> 2. I haven't done much testing with the JIT and tail calls.  I wouldn't
>>>> be
>>>>   suprised if there are minor issues that need to be fixed.  I will try
>>>>   to take a look and see what remains to be done over the next couple of
>>>>   days.
>>>
>>>
>>>
>>> As I expected, there were issues.  I fixed the following two problems:
>>>
>>> 1. The JIT didn't know where a call came from when it was a tail call (jmp
>>>    doesn't push a return address).
>>> 2. The JIT was clobbering EAX/EDX when lazily compiling a function, and
>>>    X86 fastcc wants to pass values in those registers.
>>>
>>> I think things are working now, give it a spin and lemme know if you hit
>>> any problems.
>>>
>>> -Chris
>>>
>> VC++ build is broken as a result of this change.  I'll get it fixed soon.
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> [hidden email]         http://llvm.cs.uiuc.edu
>> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
>

-Chris

--
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev