Pointer argument type in SparcISelLowering.cpp

Hi all,

I am working with the "LowerCall" function, and trying to figure out the types of all the "Outs" arguments. Specifically, I want to find out if a particular "Out[i]" argument is a pointer (of any type), or a regular data type. So far, all pointers show up as the "MVT::i32" datatype, which is not helping my cause. Is there a way to distinguish between pointers and regular MVT::i32 typed arguments in LowerCall?

Thanks.
Raghu.

Hi Raghu,

I am working with the "LowerCall" function, and trying to figure out the types of all the "Outs" arguments. Specifically, I want to find out if a particular "Out[i]" argument is a pointer (of any type), or a regular data type. So far, all pointers show up as the "MVT::i32" datatype, which is not helping my cause. Is there a way to distinguish between pointers and regular MVT::i32 typed arguments in LowerCall?

last time I checked (that was with LLVM 2.7), there was no direct way to
retrieve this information. All the backend sees are MVT::i32 values.

That's a pity because there is more than one case where you really need
to know if a value is a pointer or a regular integer. For example, some
CPU architectures such as the Infineon TriCore have disjoint sets of
registers for addresses and data.

It would be possible to add a flag "isPointer" to the EVT class and
modify SelectionDAGBuilder and a few other classes to generate and
propagate this flag during the DAG creation process. In practice, this
unfortunately requires some not-so-clean hacks in select places. It
works for me, but it's probably not the way to go if you want to do
things the right way.

Best regards
Christoph

Hi Christoph,

I totally agree..this feature is required, but like you said, hacking is not the cleanest way to accomplish it. I'm also using LLVM 2.7..I don't know if this feature exists in 2.8. But it would make my job a whole lot easier if it does :slight_smile:

Thanks !

Raghu.

I am working with the "LowerCall" function, and trying to figure out the types of all the "Outs" arguments. Specifically, I want to find out if a particular "Out[i]" argument is a pointer (of any type), or a regular data type. So far, all pointers show up as the "MVT::i32" datatype, which is not helping my cause. Is there a way to distinguish between pointers and regular MVT::i32 typed arguments in LowerCall?

last time I checked (that was with LLVM 2.7), there was no direct way to
retrieve this information. All the backend sees are MVT::i32 values.

That's a pity because there is more than one case where you really need
to know if a value is a pointer or a regular integer. For example, some
CPU architectures such as the Infineon TriCore have disjoint sets of
registers for addresses and data.

It would be possible to add a flag "isPointer" to the EVT class and
modify SelectionDAGBuilder and a few other classes to generate and
propagate this flag during the DAG creation process. In practice, this
unfortunately requires some not-so-clean hacks in select places. It
works for me, but it's probably not the way to go if you want to do
things the right way.

Best regards
Christoph