Jonas Paulsson
2010-Sep-29 08:45 UTC
[LLVMdev] passing args in registers, pointers vs integers
Hi, 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? How can I solve this problem? /Jonas
Duncan Sands
2010-Oct-20 11:10 UTC
[LLVMdev] passing args in registers, pointers vs integers
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.