[llvm] r310446 - [InstCombine] Use regular dyn_cast instead of a matcher for a simple case. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 8 23:17:48 PDT 2017
Author: ctopper
Date: Tue Aug 8 23:17:48 2017
New Revision: 310446
URL: http://llvm.org/viewvc/llvm-project?rev=310446&view=rev
Log:
[InstCombine] Use regular dyn_cast instead of a matcher for a simple case. NFC
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp?rev=310446&r1=310445&r2=310446&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp Tue Aug 8 23:17:48 2017
@@ -997,8 +997,8 @@ bool InstCombiner::shouldOptimizeCast(Ca
/// 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();
More information about the llvm-commits
mailing list