OSDN Git Service

[InstCombine] Use regular dyn_cast instead of a matcher for a simple case. NFC
authorCraig Topper <craig.topper@intel.com>
Wed, 9 Aug 2017 06:17:48 +0000 (06:17 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 9 Aug 2017 06:17:48 +0000 (06:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310446 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

index 4279427..0aea1ed 100644 (file)
@@ -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<Constant>(Logic.getOperand(1));
+  if (!C)
     return nullptr;
 
   auto LogicOpc = Logic.getOpcode();