diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp index 04a52af2d0e..17fb32eae5d 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp @@ -1429,7 +1429,7 @@ Instruction *InstCombiner::visitFDiv(BinaryOperator &I) { Value *NewInst = nullptr; Instruction *SimpR = nullptr; - if (Op0->hasOneUse() && match(Op0, m_FDiv(m_Value(X), m_Value(Y)))) { + if (match(Op0, m_OneUse(m_FDiv(m_Value(X), m_Value(Y))))) { // (X/Y) / Z => X / (Y*Z) if (!isa<Constant>(Y) || !isa<Constant>(Op1)) { NewInst = Builder.CreateFMul(Y, Op1); @@ -1440,7 +1440,7 @@ Instruction *InstCombiner::visitFDiv(BinaryOperator &I) { } SimpR = BinaryOperator::CreateFDiv(X, NewInst); } - } else if (Op1->hasOneUse() && match(Op1, m_FDiv(m_Value(X), m_Value(Y)))) { + } else if (match(Op1, m_OneUse(m_FDiv(m_Value(X), m_Value(Y))))) { // Z / (X/Y) => Z*Y / X if (!isa<Constant>(Y) || !isa<Constant>(Op0)) { NewInst = Builder.CreateFMul(Op0, Y); |

