summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-02-15 16:30:10 +0000
committerSanjay Patel <spatel@rotateright.com>2018-02-15 16:30:10 +0000
commit1e04511e16bb468b159713927e597e15becea2ef (patch)
treed6808693c0844cdc8b5cae9537758fddffb45e96 /llvm/lib/Transforms
parent9174416e89a0e906fcd9d8d8e65ef6851776b438 (diff)
downloadbcm5719-llvm-1e04511e16bb468b159713927e597e15becea2ef.tar.gz
bcm5719-llvm-1e04511e16bb468b159713927e597e15becea2ef.zip
[InstCombine] use m_OneUse to reduce code; NFC
llvm-svn: 325263
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp4
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);
OpenPOWER on IntegriCloud