[PATCH] D38466: Use the return value of UpdateNodeOperands();

Mark Searles via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 2 09:57:09 PDT 2017


msearles created this revision.
Herald added subscribers: tpr, nhaehnle, arsenm.

[ TargetLowering, AMDGPU] Use the return value of UpdateNodeOperands(); in some cases, UpdateNodeOperands() modifies the node in-place and using the return value isn’t strictly necessary. However, it does not necessarily modify the node, but may return a resultant node if it already exists in the DAG. See comments in UpdateNodeOperands(). In that case, the return value must be used to avoid such scenarios as an infinite loop (node is assumed to have been updated, so added back to the worklist, and re-processed; however, node hasn’t changed so it is once again passed to UpdateNodeOperands(), assumed modified, added back to worklist; cycle infinitely repeats).


https://reviews.llvm.org/D38466

Files:
  lib/CodeGen/SelectionDAG/TargetLowering.cpp
  lib/Target/AMDGPU/SIISelLowering.cpp
  test/CodeGen/AMDGPU/simplifydemandedbits-recursion.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38466.117376.patch
Type: text/x-patch
Size: 3797 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171002/e8d98387/attachment.bin>


More information about the llvm-commits mailing list