[LLVMdev] Lowering formal pointer arguments

Patrik Hägglund H patrik.h.hagglund at ericsson.com
Thu Mar 15 02:55:04 PDT 2012


Our target also use different registers for pointer and non-pointer parameters.

> If you need llvm::Argument, this returns the iterator pointing to the
> first argument:

DAG.getMachineFunction().getFunction() only works in LowerFormalArguments (there it returns the callee), not in LowerCall (where it returns the caller, rather than the callee). You need to pass more information about the function type to LowerCall (besides partial information such as the isVarArg parameter).

I can provide a patch if you are interested. (Unfortunately, to push this upstream has been on my to-do-list for while).

/Patrik Hägglund

-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Ivan Llopard
Sent: den 15 mars 2012 10:02
To: Akira Hatanaka
Cc: LLVM Developers Mailing List
Subject: Re: [LLVMdev] Lowering formal pointer arguments

Le 15/03/2012 03:07, Akira Hatanaka a écrit :
> If you need llvm::Argument, this returns the iterator pointing to the
> first argument:
>
> Function::const_arg_iterator Arg =
> DAG.getMachineFunction().getFunction()->arg_begin();

Thanks Akira.

Ivan
>
> On Wed, Mar 14, 2012 at 8:16 AM, Ivan Llopard<ivanllopard at gmail.com>  wrote:
>> Hi,
>>
>> How can I get the llvm-type of the formal argument while lowering it ?
>>
>> My target needs to map pointer and non-pointer parameters to different
>> registers. In addition, parameter lowering is address space dependent
>> (another reason why I need such information). Looking at the DAGBuilder,
>> I found that it is dropping it when translating llvm-types to BE types.
>> Even if the base type is saved into the MVT structure, it's a private
>> member. What's the reason for hiding it ? Why not to keep such information ?
>>
>> Thanks in advance,
>>
>> Ivan
>> _______________________________________________
>> 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




More information about the llvm-dev mailing list