diff options
author | Mark Searles <m.c.searles@gmail.com> | 2017-10-16 23:38:53 +0000 |
---|---|---|
committer | Mark Searles <m.c.searles@gmail.com> | 2017-10-16 23:38:53 +0000 |
commit | 4e3d6160db325ce5ba18be99eda2c3555e58609a (patch) | |
tree | a0ecd81c02c5c5cef23bd9dc43259b86c764abcc /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | 3bff414cdeda54ba9a08921009b390b8ed8f306d (diff) | |
download | bcm5719-llvm-4e3d6160db325ce5ba18be99eda2c3555e58609a.tar.gz bcm5719-llvm-4e3d6160db325ce5ba18be99eda2c3555e58609a.zip |
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).
Differential Revision: https://reviews.llvm.org/D38466
llvm-svn: 315957
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index a0be1c9f11f..03944321f79 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -469,7 +469,7 @@ TargetLowering::SimplifyDemandedBits(SDNode *User, unsigned OpIdx, } NewOps.push_back(User->getOperand(i)); } - TLO.DAG.UpdateNodeOperands(User, NewOps); + User = TLO.DAG.UpdateNodeOperands(User, NewOps); // Op has less users now, so we may be able to perform additional combines // with it. DCI.AddToWorklist(Op.getNode()); |