Villmow, Micah
2009-Jun-04 23:59 UTC
[LLVMdev] Subsuming a memory node of a TargetGlobalAddress with a TargetConstant node
I am trying to removing a load to a TargetGlobalAddress in ISelDagToDag that my backend does not support. The TargetGlobalAddress is assumed to always be of ConstantInt or ConstantFP type, so this transformation is valid. I am correctly able to modify the dag and remove all of the uses of the node as specified in the attached before and after dot images. The nodes in question is the CUSTOM_ADD_i32(0x002EDE80) -> load(0x002EDAC8), but I am not able to figure out how to correctly modify the chain and point the TokenFactor(0x002EDBD8) node to the llvm.opencl.other.get.global.id(0x002ED3E0) node so that I can completely remove the load, undef, and targetglobaladdress nodes. If anyone can give me any hints on how I can do this, it would be greatly appreciated. I am already creating a target specific constant and then using DAG->ReplaceAllUsesOfValueWith(Op, SDValue(N, 0)) to remove the first connect, but I'm not sure how to remove the chain. Thanks for your time, Micah -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090604/a4ba9bfc/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: before.dot Type: application/octet-stream Size: 9734 bytes Desc: before.dot URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090604/a4ba9bfc/attachment.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: after.dot Type: application/octet-stream Size: 9734 bytes Desc: after.dot URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090604/a4ba9bfc/attachment-0001.obj>
Sanjiv Gupta
2009-Jun-05 15:20 UTC
[LLVMdev] Subsuming a memory node of a TargetGlobalAddress with a TargetConstant node
Villmow, Micah wrote:> > I am trying to removing a load to a TargetGlobalAddress in > ISelDagToDag that my backend does not support. The TargetGlobalAddress > is assumed to always be of ConstantInt or ConstantFP type, so this > transformation is valid. I am correctly able to modify the dag and > remove all of the uses of the node as specified in the attached before > and after dot images. The nodes in question is the > CUSTOM_ADD_i32(0x002EDE80) -> load(0x002EDAC8), but I am not able to > figure out how to correctly modify the chain and point the > TokenFactor(0x002EDBD8) node to the > llvm.opencl.other.get.global.id(0x002ED3E0) node so that I can > completely remove the load, undef, and targetglobaladdress nodes. > > If anyone can give me any hints on how I can do this, it would be > greatly appreciated. I am already creating a target specific constant > and then using DAG->ReplaceAllUsesOfValueWith(Op, SDValue(N, 0)) to > remove the first connect, but I’m not sure how to remove the chain. > > Thanks for your time, > > Micah > >A load takes a chain as input and produces a chain as output. While removing the load node you can retrieve the incoming chain to load and put it where the out chain of load goes to. In PIC16 backend, we replace "load" with pic16 specific load node called "PIC16Load". See if PIC16 code can help. - Sanjiv> ------------------------------------------------------------------------ > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev