From: David Majnemer Date: Sat, 30 Aug 2014 09:19:05 +0000 (+0000) Subject: InstCombine: Respect recursion depth in visitUDivOperand X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b265e6f1b61d5999bd4426de145373ff630f51cd;p=oota-llvm.git InstCombine: Respect recursion depth in visitUDivOperand git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216817 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp index e7b8ed71486..3f86ddfd104 100644 --- a/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp +++ b/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp @@ -936,10 +936,10 @@ static size_t visitUDivOperand(Value *Op0, Value *Op1, const BinaryOperator &I, return 0; if (SelectInst *SI = dyn_cast(Op1)) - if (size_t LHSIdx = visitUDivOperand(Op0, SI->getOperand(1), I, Actions)) - if (visitUDivOperand(Op0, SI->getOperand(2), I, Actions)) { - Actions.push_back(UDivFoldAction((FoldUDivOperandCb)nullptr, Op1, - LHSIdx-1)); + if (size_t LHSIdx = + visitUDivOperand(Op0, SI->getOperand(1), I, Actions, Depth)) + if (visitUDivOperand(Op0, SI->getOperand(2), I, Actions, Depth)) { + Actions.push_back(UDivFoldAction(nullptr, Op1, LHSIdx - 1)); return Actions.size(); }