[LLVMdev] passing args in registers, pointers vs integers

Duncan Sands baldrick at free.fr
Wed Oct 20 04:10:05 PDT 2010


Hi Jonas,

> I need to pass pointer arguments and integer arguments in different
> register classes, but fail to do this. I am surprised to see no
> pointer type in the initial DAG and both these programs get arguments
> of i16:
>
> int fun(int a, int b) { return a+b;}
>
> int funp(int *a, int *b) { return *a+*b;}
>
> The arguments get the same MVT::i16, and as well - surprisingly - the
> same ArgFlags.Flags for both programs. Thus I cannot make a
> customization that is required. I suppose the Flags bitmap should
> indicate this, why does it not?

the code generators do not distinguish between integers and pointers
(LLVM IR makes this distinction, but it is lost once the IR has been
converted to selection DAGs).

> How can I solve this problem?

What is the "customization that is required" that you wish to do?
Perhaps it can be done before lowering to SDAG's.

Ciao,

Duncan.



More information about the llvm-dev mailing list