[LLVMdev] another problem with function arguments aligment
Chris Lattner
sabre at nondot.org
Tue Feb 27 23:53:52 PST 2007
On Tue, 27 Feb 2007, Lauro Ramos Venancio wrote:
> I think, we must move function arguments lowering from frontend to
> LLVM core. This lowering is generating machine dependent bytecode. See
> http://llvm.org/bugs/show_bug.cgi?id=1230
I agree. There are two pieces to this as I see it:
1. Make calling conventions easier to nail down. I just completed as
series of changes that allows basic calling conventions to be described
in the .td file for targets. I've converted the X86/X86-64 backends
over so far, I'll do PPC and others will do darwin/ARM in time. Here
is the X86 calling conv description:
http://llvm.org/cvsweb/cvsweb.cgi/llvm/lib/Target/X86/X86CallingConv.td?rev=HEAD&content-type=text/x-cvsweb-markup
I will document this when I have time.
2. We need to stop llvm-gcc from lowering aggregates to scalar values in
the front-end. To do this, we need some thoughtful extensions to LLVM.
This is nontrivial, but important. I don't have immediate plans to do
this, but it's on my mid-range-term todo list. Switching targets over
to use #1 is a prerequisite.
-Chris
> 2007/2/26, Chris Lattner <sabre at nondot.org>:
>> On Mon, 26 Feb 2007, Lauro Ramos Venancio wrote:
>>> The problem is: llvm-gcc generates the same bytecode for both functions:
>>>
>>> declare void @f(i32, i64)
>>> declare void @g(i32, i64)
>>>
>>> I can't differ an i64 argument from a struct argument.
>>
>> Oops. You can fix this by changing llvm-gcc: gcc/llvm-abi.h
>>
>> Grep for instances of Int64Ty there. I can help answer any q's you might
>> have.
>>
>> -Chris
>>
>> --
>> http://nondot.org/sabre/
>> http://llvm.org/
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-Chris
--
http://nondot.org/sabre/
http://llvm.org/
More information about the llvm-dev
mailing list