[llvm] r216817 - InstCombine: Respect recursion depth in visitUDivOperand
David Majnemer
david.majnemer at gmail.com
Sat Aug 30 02:19:07 PDT 2014
Author: majnemer
Date: Sat Aug 30 04:19:05 2014
New Revision: 216817
URL: http://llvm.org/viewvc/llvm-project?rev=216817&view=rev
Log:
InstCombine: Respect recursion depth in visitUDivOperand
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp?rev=216817&r1=216816&r2=216817&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp Sat Aug 30 04:19:05 2014
@@ -936,10 +936,10 @@ static size_t visitUDivOperand(Value *Op
return 0;
if (SelectInst *SI = dyn_cast<SelectInst>(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();
}
More information about the llvm-commits
mailing list