diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 8fd0001b4eb3f3..954f30d4df4e72 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -24037,7 +24037,7 @@ void DAGCombiner::GatherAllAliases(SDNode *N, SDValue OriginalChain, } for (unsigned n = Chain.getNumOperands(); n;) Chains.push_back(Chain.getOperand(--n)); - ++Depth; + Depth += Chain.getNumOperands(); continue; } // Everything else