[llvm-commits] [PATCH] Remove tail marker when changing an argument to an alloca.

Duncan Sands baldrick at free.fr
Thu Jan 3 21:59:12 PST 2013


Hi Rafael,

On 02/01/13 01:49, Rafael EspĂ­ndola wrote:
> On 1 January 2013 12:26, Duncan Sands <baldrick at free.fr> wrote:
>> Hi Rafael, if a call uses a 'byval' parameter, should it be marked as a tail
>> call in the first place?  After all, byval implicitly places a copy of the
>> passed argument on the stack, so the call is implicitly using the stack.
>> There is the question of who puts the copy on the stack: the caller or the
>> callee?  If the former, maybe there isn't a problem after all...
>
> That is an interesting point. On one hand, we cannot produce an tail
> call (as in, an actual jump) for
>
> %X = type { i32 }
> define void @g(%X* byval %b, %X* byval %a) {
> entry:
>    tail call void @f(%X* %a, %X* %b)
>    ret void
> }
> declare void @f(%X* byval, %X* byval)

^ presumably here this should have been:
   declare void @f(%X*, %X*)

>
>
> but it would be nice to remain the ability of producing one for
>
> %X = type { i32 }
> define void @g(%X* byval %a) {
> entry:
>    tail call void @f(%X* %a)

^ presumably here this should have been:
   tail call void @f(%X* byval %a)

>    ret void
> }
> declare void @f(%X* byval)

Ciao, Duncan.





More information about the llvm-commits mailing list