[llvm-dev] Way to know if an Operand of a SelectionDAG is a pointer

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Way to know if an Operand of a SelectionDAG is a pointer

Adam Nemet via llvm-dev
Hi everyone,

We developed a new backend for our architecture based on LLVM 3.8, I'm
sorry about that, I quite understand if my questions do not get any
answers because of that.

We have some instructions that allow to protect pointers that sit in our
small scratch-area.

I did not find a way to know, when selecting the machine instructions,
if one of the operands of the SDNode is a pointer. Do you know how I
could get this info ?

Thanks for your time,

Alex

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Way to know if an Operand of a SelectionDAG is a pointer

Adam Nemet via llvm-dev
You cannot detect that by simply looking at the DAG. The way such things
are usually done is that you invent your own SDNode that represents the
property that you want to examine later. In your case it could be
something like YourTargetISD::SMALL_SCRATCH_POINTER, which would take
one value and return one value. This node would not cause any code to be
generated for it, it would only serve as a "label" indicating that its
operand is special in some way.

-Krzysztof

On 5/4/2018 1:03 AM, Alexandre Ghiti via llvm-dev wrote:

> Hi everyone,
>
> We developed a new backend for our architecture based on LLVM 3.8, I'm
> sorry about that, I quite understand if my questions do not get any
> answers because of that.
>
> We have some instructions that allow to protect pointers that sit in our
> small scratch-area.
>
> I did not find a way to know, when selecting the machine instructions,
> if one of the operands of the SDNode is a pointer. Do you know how I
> could get this info ?
>
> Thanks for your time,
>
> Alex
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Way to know if an Operand of a SelectionDAG is a pointer

Adam Nemet via llvm-dev
Krzysztof,

Thank you very much for your answer, I did not know how to tackle this
properly, thanks for taking the time to explain how things are usually done.

And sorry for my response delay,

Thank you again,

Alex


On 05/04/2018 05:18 PM, Krzysztof Parzyszek via llvm-dev wrote:

> You cannot detect that by simply looking at the DAG. The way such
> things are usually done is that you invent your own SDNode that
> represents the property that you want to examine later. In your case
> it could be something like YourTargetISD::SMALL_SCRATCH_POINTER, which
> would take one value and return one value. This node would not cause
> any code to be generated for it, it would only serve as a "label"
> indicating that its operand is special in some way.
>
> -Krzysztof
>
> On 5/4/2018 1:03 AM, Alexandre Ghiti via llvm-dev wrote:
>> Hi everyone,
>>
>> We developed a new backend for our architecture based on LLVM 3.8,
>> I'm sorry about that, I quite understand if my questions do not get
>> any answers because of that.
>>
>> We have some instructions that allow to protect pointers that sit in
>> our small scratch-area.
>>
>> I did not find a way to know, when selecting the machine
>> instructions, if one of the operands of the SDNode is a pointer. Do
>> you know how I could get this info ?
>>
>> Thanks for your time,
>>
>> Alex
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev