From: Craig Topper Date: Wed, 9 Aug 2017 06:17:48 +0000 (+0000) Subject: [InstCombine] Use regular dyn_cast instead of a matcher for a simple case. NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6897f5c0e8cc06a93c3ba8522c4a3a01de65a52e;p=llvm [InstCombine] Use regular dyn_cast instead of a matcher for a simple case. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310446 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index 4279427a8b9..0aea1edb0d0 100644 --- a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp +++ b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp @@ -997,8 +997,8 @@ bool InstCombiner::shouldOptimizeCast(CastInst *CI) { /// Fold {and,or,xor} (cast X), C. static Instruction *foldLogicCastConstant(BinaryOperator &Logic, CastInst *Cast, InstCombiner::BuilderTy &Builder) { - Constant *C; - if (!match(Logic.getOperand(1), m_Constant(C))) + Constant *C = dyn_cast(Logic.getOperand(1)); + if (!C) return nullptr; auto LogicOpc = Logic.getOpcode();