[LLVMdev] LLVM Backend

Ambuj Agrawal ambujbwt at gmail.com
Mon Feb 16 08:22:20 PST 2015


I am working on LLVM backend and was wondering if there is any way by which
I can access the value stored SDValue so I can either assign it as a
literal or move it to register in an user defined instruction.

Something like:
SDValue Value   = Op->getOperand(2);
intValue = Value.get_integer_value  //get Value as an int
and then
if ( intValue > 31)
    emit udi 0,0,0,intValue
else
{
  emit
  load v1,intValue
  udi v1,0,0,0
}



On Mon, Feb 16, 2015 at 4:19 PM, Ambuj Agrawal <ambujbwt at gmail.com> wrote:

> I am working on LLVM backend and was wondering if there is any way by
> which I can access the value stored SDValue so I can either assign it as a
> literal or move it to register in an user defined instruction.
>
> Something like:
> SDValue Value   = Op->getOperand(2);
>
> intValue = Value.get_integer_value  //get Value as an int
>
> and then
>
> if ( intValue > 31)
>
>
>
> Thanks,
> Ambuj
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150216/48ecfa6a/attachment.html>


More information about the llvm-dev mailing list