[LLVMdev] Pointer argument type in SparcISelLowering.cpp

Christoph Erhardt christoph at sicherha.de
Mon Jan 31 12:01:32 PST 2011


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



More information about the llvm-dev mailing list