OSDN Git Service

[InstCombine] Replace a simple matcher with a plain old dyn_cast. NFC
authorCraig Topper <craig.topper@intel.com>
Wed, 23 Aug 2017 05:46:08 +0000 (05:46 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 23 Aug 2017 05:46:08 +0000 (05:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311528 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineCompares.cpp

index 19a37c1..55f49b0 100644 (file)
@@ -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<BinaryOperator>(Cmp.getOperand(0))) {
     switch (BO->getOpcode()) {
     case Instruction::Xor:
       if (Instruction *I = foldICmpXorConstant(Cmp, BO, C))