[LLVMdev] Subsuming a memory node of a TargetGlobalAddress with a TargetConstant node

Villmow, Micah Micah.Villmow at amd.com
Thu Jun 4 16:59:53 PDT 2009


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>


More information about the llvm-dev mailing list