summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-01-10 23:08:54 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-01-10 23:08:54 +0000
commitfdb78f8baee78909c8003d5dff92dee76d50c6d0 (patch)
treec63ac64436718a1cf3c0073b0bb2145401a638d5 /llvm/lib/Transforms
parent20d252c4c1bb982555457cd8df72cfd28523da27 (diff)
downloadbcm5719-llvm-fdb78f8baee78909c8003d5dff92dee76d50c6d0.tar.gz
bcm5719-llvm-fdb78f8baee78909c8003d5dff92dee76d50c6d0.zip
InstCombine: fdiv -x, -y -> fdiv x, y
llvm-svn: 291611
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index ac64671725f..04f03844ea6 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -1443,6 +1443,16 @@ Instruction *InstCombiner::visitFDiv(BinaryOperator &I) {
}
}
+ Value *LHS;
+ Value *RHS;
+
+ // -x / -y -> x / y
+ if (match(Op0, m_FNeg(m_Value(LHS))) && match(Op1, m_FNeg(m_Value(RHS)))) {
+ I.setOperand(0, LHS);
+ I.setOperand(1, RHS);
+ return &I;
+ }
+
return nullptr;
}
OpenPOWER on IntegriCloud