From: Craig Topper Date: Wed, 23 Aug 2017 05:46:08 +0000 (+0000) Subject: [InstCombine] Replace a simple matcher with a plain old dyn_cast. NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de8d0349165ce949deaa2dd8d5952032303d0f0c;p=llvm [InstCombine] Replace a simple matcher with a plain old dyn_cast. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311528 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombineCompares.cpp b/lib/Transforms/InstCombine/InstCombineCompares.cpp index 19a37c18140..55f49b0e4d6 100644 --- a/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -2524,8 +2524,7 @@ Instruction *InstCombiner::foldICmpInstWithConstant(ICmpInst &Cmp) { if (!match(Cmp.getOperand(1), m_APInt(C))) return nullptr; - BinaryOperator *BO; - if (match(Cmp.getOperand(0), m_BinOp(BO))) { + if (auto *BO = dyn_cast(Cmp.getOperand(0))) { switch (BO->getOpcode()) { case Instruction::Xor: if (Instruction *I = foldICmpXorConstant(Cmp, BO, C))