[LLVMdev] to lower "write to argument pointer"

kewuzhang kewu.zhang at amd.com
Mon Jul 28 21:25:55 PDT 2014


Drear there:

The problem I have is  to lower an intrinsic function like this
”
float @llvm.write.arg(flaot %src, float* %dst)
“
I am lowering it with INTRINSIC_W_CHAIN,  so the return value and the value to write to dst are generated with some operations using src:

"
 // it is the frame index node corresponding to input pointer
SDvalue frindex = Op.getoperand(3);
…
SDValue returnValue = DAG.getNode(myNode1, DL, VT….);

SDValue dstValue 	= DAG.getNode(myNode2, DL, VT….);

// to save the value to dst pointer, I think I need some call like 
SDValue dstOut = DAG.getStore(chain, DL, dstValue, FrameIndex, MachinePointerInfo(), false, false, 0);

“
I have two questions here: 
(1)  should I return some merges values( returnValue, DstValue) ? or only return returnValue is right? ( the dag dumped out  looks better if I return the merged values)
(2) How the FrameIndex should be computed? I use  DAG.getFrameIndex((dyn_cast<FrameIndexSDnode>( frindex.getNode()))->getIndex(), i32), not confident it is correct, any good examples to understand to this?

Best

Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140729/cb44e46b/attachment.html>


More information about the llvm-dev mailing list