From de8d0349165ce949deaa2dd8d5952032303d0f0c Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 23 Aug 2017 05:46:08 +0000 Subject: [PATCH] [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 --- lib/Transforms/InstCombine/InstCombineCompares.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)) -- 2.50.1