[LLVMdev] LLVM register number for MIPS DAGToDAG

Ambuj Agrawal ambujbwt at gmail.com
Fri Feb 27 01:59:38 PST 2015


Is it possible to get a register number to which the value is allocated to
in MIPS in DAGToDAG class?

More Specifically:
                    SDValue Reg3 = Node->getOperand(3);
                    if (RegisterSDNode *R = dyn_cast<RegisterSDNode>(Reg3))
                    {
                        op3 = cast<RegisterSDNode>(Reg3)->getReg();
                        fprintf(stderr,"Op3 is register and regnum is
%d\n",op3);
                    }
                    else if (ConstantSDNode *C =
dyn_cast<ConstantSDNode>(Reg3))
                    {
                        op3 = C->getZExtValue();
                        fprintf(stderr,"Op3 is constant and value is
%d\n",op3);
                    }

When I run this code Reg3 is found out to be a ConstantSDNode but is stored
in the register in assembly. I want to store the value in register but also
need the register number to which the value is allocated.

Thanks,
Ambuj Agrawal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150227/eb92dacd/attachment.html>


More information about the llvm-dev mailing list