Displaying 20 results from an estimated 50000 matches similar to: "[LLVMdev] First-class aggregate semantics"
2010 Jan 07
0
[LLVMdev] First-class aggregate semantics
On Thursday 07 January 2010 15:28, Dustin Laurence wrote:
> I think I'm missing something basic about the semantics of returning an
> aggregate type (in my case, a structure) from a function. Returning a
> structure containing only compile-time constants is simple enough. But
> I don't quite get how this works with a struct composed at run-time. If
> I constructed it on
2010 Jan 07
6
[LLVMdev] First-class aggregate semantics
On 01/07/2010 01:38 PM, David Greene wrote:
> The way this works on many targets is that the caller allocates stack
> space in its frame for the returned struct and passes a pointer to it
> as a first "hidden" argument to the callee. The callee then copies
> that data into the space pointed to by the address.
<nod>
> Long-term, first-class status means that
2010 Jan 08
0
[LLVMdev] First-class aggregate semantics
Hi Dustin,
> I think I'm missing something basic about the semantics of returning an
> aggregate type (in my case, a structure) from a function. Returning a
> structure containing only compile-time constants is simple enough. But
> I don't quite get how this works with a struct composed at run-time. If
> I constructed it on the stack with alloca, would I be letting a
2010 Jan 08
0
[LLVMdev] First-class aggregate semantics
On Thursday 07 January 2010 21:56:11 Dustin Laurence wrote:
> On 01/07/2010 01:38 PM, David Greene wrote:
> > The way this works on many targets is that the caller allocates stack
> > space in its frame for the returned struct and passes a pointer to it
> > as a first "hidden" argument to the callee. The callee then copies
> > that data into the space pointed
2010 Jan 07
1
[LLVMdev] First-class aggregate semantics
On Thu, Jan 7, 2010 at 3:38 PM, David Greene <dag at cray.com> wrote:
> On Thursday 07 January 2010 15:28, Dustin Laurence wrote:
>> I think I'm missing something basic about the semantics of returning an
>> aggregate type (in my case, a structure) from a function. Returning a
>> structure containing only compile-time constants is simple enough. But
>> I
2010 Jan 08
0
[LLVMdev] First-class aggregate semantics
Hi Dustin-
You'll probably need to use insertvalue to construct your return value.
Alastair
On 7 Jan 2010, at 21:56, Dustin Laurence wrote:
> define %Token @foo()
> {
> ...
>
> ret %Token {%c_int %token, %i8* %value}
> }
2009 Dec 20
3
[LLVMdev] Status of first-class aggregate types
What's the current status on support for first-class structs? The last I
heard was:
- Structs which are smaller or equal to two pointers can be passed /
returned / loaded / stored by value.
- There are plans to expand this in the future to support arbitrary-sized
structs as first class values. (Probably via some transformation pass the
converts the return value into a hidden
2010 Jan 08
2
[LLVMdev] First-class aggregate semantics
On 01/07/2010 06:03 PM, Alastair Lynn wrote:
>
> You'll probably need to use insertvalue to construct your return value.
Ah ha!
The fact is I didn't really understand the significance of this part
when I read it, and so didn't remember it when I needed it. OK, so I
have tested it and I can now build up a struct like this
%s1 = insertvalue {i32, i32} {i32 0, i32 0}, i32
2010 Jan 09
0
[LLVMdev] First-class aggregate semantics
Dustin Laurence wrote:
> On 01/07/2010 06:03 PM, Alastair Lynn wrote:
>
>> You'll probably need to use insertvalue to construct your return value.
>>
>
> Ah ha!
>
> The fact is I didn't really understand the significance of this part
> when I read it, and so didn't remember it when I needed it. OK, so I
> have tested it and I can now build
2009 Dec 20
0
[LLVMdev] Status of first-class aggregate types
On Dec 20, 2009, at 12:27 AM, Talin wrote:
> What's the current status on support for first-class structs? The last I heard was:
> Structs which are smaller or equal to two pointers can be passed / returned / loaded / stored by value.
> There are plans to expand this in the future to support arbitrary-sized structs as first class values. (Probably via some transformation pass the
2009 Feb 23
3
[LLVMdev] Broke my tail (call)
Hello Duncan and Jon,
I am the criminal responsible for the tail call implementation in the backends.
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 get
>> eliminated on x86 and x64 it should be a tail call, yes.
See below.
> this list is for the code
2009 Jul 16
0
[LLVMdev] x86 unwind support
On Thu, Jul 16, 2009 at 9:10 AM, Kenneth Uildriks<kennethuil at gmail.com> wrote:
> 1. Which ones? I know that Windows uses it for the "this" pointer.
The internal fastcc convention and the Windows fastcall convention off
the top of my head.
> Anyway, unless the callee is required to preserve it in a given
> calling convention, that doesn't preclude us using it for
2013 Jul 05
4
[LLVMdev] making a copy of a byval aggregate on the callee's frame
Hi Tim,
Thought about it last night and was coming to the same conclusion.
1. it cant be done at the end during lowering (target backend).
2. it should be part of llvm as the byVal needs to be handled.
As a twist, I have been told that llvm-gcc can lower byVal into memcpy in the callee.
I may take a look at this.
I wonder if it ever emits 'byVal'...
I still feel I don't understand
2009 Jul 16
3
[LLVMdev] x86 unwind support
1. Which ones? I know that Windows uses it for the "this" pointer.
Anyway, unless the callee is required to preserve it in a given
calling convention, that doesn't preclude us using it for a *return*
value. It would be checked after calls return, and wouldn't affect
the use of the register for passing values in before the call is made.
The callee would set it right before
2009 Dec 20
2
[LLVMdev] Status of first-class aggregate types
On Sun, Dec 20, 2009 at 9:50 AM, Chris Lattner <clattner at apple.com> wrote:
>
> On Dec 20, 2009, at 12:27 AM, Talin wrote:
>
> What's the current status on support for first-class structs? The last I
> heard was:
>
> - Structs which are smaller or equal to two pointers can be passed /
> returned / loaded / stored by value.
> - There are plans to
2013 Nov 03
3
[LLVMdev] freeing alloca'd variables before function exits
Hi,
In my llvm code I want to create some function calls. The function prototype is as follows:
int memoize ( char *function_name,
int *int_params, unsigned num_ints,
double *double_params, unsigned num_doubles)
In order to create these calls I do the following for example:
%88 = alloca [7 x i8]
store volatile [7 x i8] c"ORACLE\00", [7 x i8]*
2014 Dec 31
3
[LLVMdev] First class aggregates of small size: split when used in function call
Hello,
In my LLVM frontend (CLR/MSIL), I am currently using first-class aggregates
to represent loaded value types on the "CLR stack".
However, I noticed that when calling external method taking those aggregate
by value, they were not passed as I expected:
%COLORREF = type { i8, i8, i8, i8 }
declare i32 @SetLayeredWindowAttributes(i8*, %COLORREF, i8, i32)
I call this function with
2009 Dec 21
0
[LLVMdev] Status of first-class aggregate types
On Dec 20, 2009, at 10:27 AM, Talin wrote:
> I'd pass them by value if they are small but by reference if they are large. Passing large tuples by value isn't going to provide a win.
>
> OK, thanks for that confirmation, now I can proceed ahead with less trepidation. :)
>
> For large aggregates (well, not huge, but the size of a typical structure or class), do you
2013 Nov 04
0
[LLVMdev] freeing alloca'd variables before function exits
Stack colouring should be able to reuse the same stack space, if the live
ranges of the pointers don't overlap. But I don't think anyone has built a
general solution for alloca'd space.
On Mon, Nov 4, 2013 at 6:30 AM, Ali Javadi <aj14889 at yahoo.com> wrote:
> Hi,
>
> In my llvm code I want to create some function calls. The function
> prototype is as follows:
>
2016 Mar 02
2
RFC: Implementing the Swift calling convention in LLVM and Clang
> On Mar 2, 2016, at 11:33 AM, Renato Golin <renato.golin at linaro.org> wrote:
> On 2 March 2016 at 18:48, John McCall <rjmccall at apple.com> wrote:
>> The frontend will not tell the backend explicitly which parameters will be
>> in registers; it will just pass a bunch of independent scalar values, and
>> the backend will assign them to registers or the stack