diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-09-26 09:32:41 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-09-26 09:32:41 +0000 |
commit | 79597d2af6e1bd80a7768eab3b380d3d71469f5d (patch) | |
tree | bc9d4f4274b06c56907e4b60e255444ba66fda03 /lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | 3dd1170616001e38b4dd899d5990734cea339663 (diff) |
Chain can be any operand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30611 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 9a78459ede..32a81a044d 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -3956,17 +3956,15 @@ SDOperand DAGCombiner::BuildUDIV(SDNode *N) { /// hasChainUsers - Returns true if one of the users of a load node has the /// chain result as an operand. bool DAGCombiner::hasChainUsers(SDNode *Load) { - // Don't even bother if the load only has one user (conservatively the value.) - if (!Load->hasOneUse()) { - SDOperand Chain(Load, 1); // The load's chain result. - - // For each user of the load. - for (SDNode::use_iterator UI = Load->use_begin(), UE = Load->use_end(); - UI != UE; ++UI) { - - // Chain will be the first operand. - if ((*UI)->getOperand(0) == Chain) - return true; + SDOperand Chain(Load, 1); // The load's chain result. + + // For each user of the load. + for (SDNode::use_iterator UI = Load->use_begin(), UE = Load->use_end(); + UI != UE; ++UI) { + const SDNode *User = *UI; + + for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i) { + if (User->getOperand(i) == Chain) return true; } } |