Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] Status of multiple return values"
2009 Mar 28
0
[LLVMdev] Broke my tail (call)
On Tuesday 24 February 2009 14:54:12 Arnold Schwaighofer wrote:
> On Tue, Feb 24, 2009 at 11:50 AM, Jon Harrop <jon at ffconsultancy.com> wrote:
> > Thanks for the clarification. That makes a lot more sense!
> >
> > LLVM's support for structs is wonderful but I don't think they can be
> > called "first-class structs" until all such arbitrary
2009 Feb 24
4
[LLVMdev] Broke my tail (call)
On Tue, Feb 24, 2009 at 11:50 AM, Jon Harrop <jon at ffconsultancy.com> wrote:
> Thanks for the clarification. That makes a lot more sense!
>
> LLVM's support for structs is wonderful but I don't think they can be
> called "first-class structs" until all such arbitrary restrictions have been
> removed, even though the workaround (using sret form) is trivial
2009 Feb 24
0
[LLVMdev] Broke my tail (call)
On Monday 23 February 2009 16:14:57 Arnold Schwaighofer wrote:
> The problem has to do with how struct returns are represented
> internally by llvm (in the SelectionDAG) and how the tail call
> optimization implementation checks if it may perform the tail call.
> The implementation checks that the <call> node is immediately followed
> by a <ret> node. A struct return
2010 Jan 04
0
[LLVMdev] Tail Call Optimisation
On Monday 04 January 2010 05:16:40 Jeffrey Yasskin wrote:
> On Sun, Jan 3, 2010 at 10:50 PM, Jon Harrop <jon at ffconsultancy.com> wrote:
> > LLVM's TCO already handles mutual recursion.
>
> Only for fastcc functions
Yes.
> compiled with -tailcallopt, right?
If you use the compiler, yes.
> http://llvm.org/docs/CodeGenerator.html#tailcallopt
>
> I believe
2009 Feb 23
3
[LLVMdev] Broke my tail (call)
On Mon, Feb 23, 2009 at 2:13 PM, Jon Harrop <jon at ffconsultancy.com> wrote:
> Moreover, I now have evidence that LLVM is not behaving as you expect:
>
> 3. Adjusting the return value from this function into sret form results in
> tail call elimination being performed correctly. Note that this is still
> passing a first-class struct by value as an argument to a function
2009 Nov 25
3
[LLVMdev] Possible bug in TCO?
My compiler is generating a bunch of code including the following line:
%57 = call fastcc i32 @aux(%1* %0, %1 %1, %1 %46, i32 0, %4 %2) ; <i32>
[#uses=1]
ret i32 %57
The program works fine as long as this isn't a tail call. If I compile via
a .ll and insert "tail" by hand, the program segfaults. However, if I make it
a tail call and return an undef i8* or void instead
2008 Dec 18
2
[LLVMdev] Mixing calling conventions
Are you not supposed to be able to call a FastCC function from a CCC function?
I'm calling a CCC "main" function from OCaml and that "main" function calls
internal functions that require tail calls. With CCC everywhere it works
(except I don't get tail calls). If I use FastCC on all functions
except "main" then the function arguments are garbage.
Should I
2009 Feb 22
3
[LLVMdev] Broke my tail (call)
I have written a variety tests of tail calls for my HLVM and all passed with
flying colors until I wrote this test (which is actually for algebraic
datatypes) and discovered that it segfaults after ~100k iterations through
what I think should be a tail call. Here's the IR:
define fastcc { { i8*, i8* }*, i8* } @init({ { i8*, i8* }*, i8* }, i32) {
entry:
%2 = alloca { i32, { { i8*,
2009 Feb 05
2
[LLVMdev] First class function pointers
Unless I am mistaken, LLVM barfs if I try to pass an LLVM function to another
function as an argument because functions are second class. However, if I
const bitcast the LLVM function to a function pointer when it is defined then
I can use that as a first-class function pointer. In particular, I can invoke
it directly by emitting a "call" without having to cast it back beforehand.
2009 Feb 23
0
[LLVMdev] Broke my tail (call)
On Monday 23 February 2009 12:08:00 Arnold Schwaighofer wrote:
> Hello Duncan and Jon,
>
> I am the criminal responsible for the tail call implementation in the
> backends.
Thanks! :-)
> On Mon, Feb 23, 2009 at 9:17 AM, Duncan Sands <baldrick at free.fr> wrote:
> > Hi Jon,
> >
> >> >From what I have understood of the LLVM docs about when tail calls
2010 Jan 04
2
[LLVMdev] Tail Call Optimisation
On Sun, Jan 3, 2010 at 10:50 PM, Jon Harrop <jon at ffconsultancy.com> wrote:
> On Monday 04 January 2010 03:33:06 Simon Harris wrote:
>> On 04/01/2010, at 3:01 PM, Jon Harrop wrote:
>> > I am certainly interested in tail calls because my HLVM project relies
>> > upon LLVM's tail call elimination. However, I do not understand what tail
>> > calls LLVM
2010 Jan 04
0
[LLVMdev] Tail Call Optimisation
On Monday 04 January 2010 03:33:06 Simon Harris wrote:
> On 04/01/2010, at 3:01 PM, Jon Harrop wrote:
> > I am certainly interested in tail calls because my HLVM project relies
> > upon LLVM's tail call elimination. However, I do not understand what tail
> > calls LLVM is not currently eliminating that you plan to eliminate?
>
> Mutual recursion for a start:
>
2009 Nov 13
2
[LLVMdev] opt -std-compile-opts breaks tail calls
On Friday 13 November 2009 16:26:01 Chris Lattner wrote:
> On Nov 13, 2009, at 3:34 AM, Jon Harrop wrote:
> >> Point 4 is the one that caused me trouble for some time.
> >> Unfortunately
> >> it causes a bad interaction with the optimiser, specifically the
> >> 'simplifycfg' pass. What seems to happen is that since the function
> >> you are
2009 Nov 13
2
[LLVMdev] opt -std-compile-opts breaks tail calls
On Friday 13 November 2009 04:57:43 David Terei wrote:
> I've run into some issues with tail calls in the past, make sure you
> are doing the following:
>
> 1. Call should be marked with tail (obviously)
> 2. Next statement after tail call should be 'return void'
> 3. Use fast call convention for tail calls
> 4. Make sure the function you are calling doesn't
2009 Nov 20
2
[LLVMdev] llc barfing
I was playing with optimization switches to llc to see how fast I could get it
to compile but it keeps barfing. Tinkering indicates that llc barfs
particularly when -tailcallopt is given in combination with other flags. For
example, without -tailcallopt works in a couple of ways:
$ llc -O0 -f aout.bc -o aout.s
$ llc -O0 --regalloc=local -f aout.bc -o aout.s
But fails with -tailcallopt with
2009 Feb 06
1
[LLVMdev] First class function pointers
On Friday 06 February 2009 03:33:57 Chris Lattner wrote:
> On Feb 5, 2009, at 3:42 PM, Jon Harrop wrote:
> > Unless I am mistaken, LLVM barfs if I try to pass an LLVM function
> > to another
> > function as an argument because functions are second class.
>
> Huh? can you give an example as llvm IR? You can certainly pass
> functions by-value as a function pointer.
2009 Feb 19
6
[LLVMdev] Improving performance with optimization passes
I'm toying with benchmarks on my HLVM and am unable to get any performance
improvement from optimization passes. Moreover, some of my programs generate
a lot of redundant code (e.g. alloca a struct, store a struct into it and
read only one field without using the rest of the struct) and this does not
appear to be optimized away.
I simply copied the use of PassManager from the Kaleidoscope
2008 Dec 16
4
[LLVMdev] First-class structs
Apologies for the dumb questions but I'm rustier than I had hoped on this.
I'm trying to write a mini ML implementation and am considering trying to
optimize tuples into structs to avoid heap allocation when possible. Tuples
are often used to return multiple values in ML so I am likely to wind up
returning structs from functions.
I also want to support as much of a C-like
2010 Feb 24
0
[LLVMdev] C Compiler written in OCaml, Pointers Wanted
On Wed, Feb 24, 2010 at 7:10 AM, Jon Harrop <jon at ffconsultancy.com> wrote:
> On Wednesday 24 February 2010 03:58:03 Jianzhou Zhao wrote:
>> I think LLVM OCaml bindings do not support JIT too much.
>
> Can you elaborate on this?
I meant the OCaml bindings let OCaml call existing C++ LLVM routines,
such as creating an execution engine, JIT-ing a function with existing JIT
or
2010 Feb 24
2
[LLVMdev] C Compiler written in OCaml, Pointers Wanted
On Wednesday 24 February 2010 03:58:03 Jianzhou Zhao wrote:
> I think LLVM OCaml bindings do not support JIT too much.
Can you elaborate on this?
Several major projects are using OCaml's LLVM bindings to execute non-trivial
code via JIT.
--
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e