summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-02-14 16:56:44 +0000
committerSanjay Patel <spatel@rotateright.com>2018-02-14 16:56:44 +0000
commit58dab856f7536c6d040d39393c2f7af9c931dd69 (patch)
tree995452f82bea27a7d37477fcc576d2569ba5c694 /llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
parent604cb9e3eda1c959639de3c7d5864f48a26929f8 (diff)
downloadbcm5719-llvm-58dab856f7536c6d040d39393c2f7af9c931dd69.tar.gz
bcm5719-llvm-58dab856f7536c6d040d39393c2f7af9c931dd69.zip
[InstCombine] replace isa/cast with dyn_cast; NFC
llvm-svn: 325141
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index f884221bff1..e853a7bb64d 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -596,19 +596,18 @@ Instruction *InstCombiner::visitFMul(BinaryOperator &I) {
bool AllowReassociate = I.isFast();
// Simplify mul instructions with a constant RHS.
- if (isa<Constant>(Op1)) {
+ if (auto *C = dyn_cast<Constant>(Op1)) {
if (Instruction *FoldedMul = foldOpWithConstantIntoOperand(I))
return FoldedMul;
// (fmul X, -1.0) --> (fsub -0.0, X)
- if (match(Op1, m_SpecificFP(-1.0))) {
+ if (match(C, m_SpecificFP(-1.0))) {
Constant *NegZero = ConstantFP::getNegativeZero(Op1->getType());
Instruction *RI = BinaryOperator::CreateFSub(NegZero, Op0);
RI->copyFastMathFlags(&I);
return RI;
}
- Constant *C = cast<Constant>(Op1);
if (AllowReassociate && isFiniteNonZeroFp(C)) {
// Let MDC denote an expression in one of these forms:
// X * C, C/X, X/C, where C is a constant.
OpenPOWER on IntegriCloud