diff options
| author | Craig Topper <craig.topper@intel.com> | 2018-09-11 16:51:26 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2018-09-11 16:51:26 +0000 |
| commit | 12fd6bd4ad8f472304dc51120c11125f5627160b (patch) | |
| tree | b4143338555f9f3445aad7a5dabbd13aac40528f | |
| parent | a57bb61a3e87bad1d701c1c98fc9d1d6bd6563e4 (diff) | |
| download | bcm5719-llvm-12fd6bd4ad8f472304dc51120c11125f5627160b.tar.gz bcm5719-llvm-12fd6bd4ad8f472304dc51120c11125f5627160b.zip | |
[InstCombine] Use dyn_cast instead of match(m_Constant). NFC
llvm-svn: 341962
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp index 30067fe4871..73328666c09 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp @@ -1195,8 +1195,7 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) { // integer add followed by a sext. if (SExtInst *LHSConv = dyn_cast<SExtInst>(LHS)) { // (add (sext x), cst) --> (sext (add x, cst')) - Constant *RHSC; - if (match(RHS, m_Constant(RHSC))) { + if (auto *RHSC = dyn_cast<Constant>(RHS)) { if (LHSConv->hasOneUse()) { Constant *CI = ConstantExpr::getTrunc(RHSC, LHSConv->getOperand(0)->getType()); @@ -1232,8 +1231,7 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) { // integer add followed by a zext. if (auto *LHSConv = dyn_cast<ZExtInst>(LHS)) { // (add (zext x), cst) --> (zext (add x, cst')) - Constant *RHSC; - if (match(RHS, m_Constant(RHSC))) { + if (auto *RHSC = dyn_cast<Constant>(RHS)) { if (LHSConv->hasOneUse()) { Constant *CI = ConstantExpr::getTrunc(RHSC, LHSConv->getOperand(0)->getType()); |

