summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-02-06 17:16:16 +0000
committerSanjay Patel <spatel@rotateright.com>2017-02-06 17:16:16 +0000
commitcf4c90f3d3861e44175b6e081af8fedfd8217e9a (patch)
tree0a6aef5cb00f86cbaba80c52e7bd2728ab15d89d /llvm/lib
parent82a86cb155d1dff1dea9d6adff946abb93b996dc (diff)
downloadbcm5719-llvm-cf4c90f3d3861e44175b6e081af8fedfd8217e9a.tar.gz
bcm5719-llvm-cf4c90f3d3861e44175b6e081af8fedfd8217e9a.zip
[InstCombine] simplify dyn_cast + isa; NFCI
llvm-svn: 294198
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstructionCombining.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index b74b3273acd..ba65ea6f510 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -568,13 +568,11 @@ static Value *tryFactorization(InstCombiner::BuilderTy *Builder,
if (isa<OverflowingBinaryOperator>(&I))
HasNSW = I.hasNoSignedWrap();
- if (BinaryOperator *Op0 = dyn_cast<BinaryOperator>(LHS))
- if (isa<OverflowingBinaryOperator>(Op0))
- HasNSW &= Op0->hasNoSignedWrap();
+ if (auto *LOBO = dyn_cast<OverflowingBinaryOperator>(LHS))
+ HasNSW &= LOBO->hasNoSignedWrap();
- if (BinaryOperator *Op1 = dyn_cast<BinaryOperator>(RHS))
- if (isa<OverflowingBinaryOperator>(Op1))
- HasNSW &= Op1->hasNoSignedWrap();
+ if (auto *ROBO = dyn_cast<OverflowingBinaryOperator>(RHS))
+ HasNSW &= ROBO->hasNoSignedWrap();
// We can propagate 'nsw' if we know that
// %Y = mul nsw i16 %X, C
OpenPOWER on IntegriCloud