diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-02-06 17:16:16 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-02-06 17:16:16 +0000 |
commit | cf4c90f3d3861e44175b6e081af8fedfd8217e9a (patch) | |
tree | 0a6aef5cb00f86cbaba80c52e7bd2728ab15d89d /llvm/lib | |
parent | 82a86cb155d1dff1dea9d6adff946abb93b996dc (diff) | |
download | bcm5719-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.cpp | 10 |
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 |