From 9bb85ad4f77bcb8a1f1bea48b63c4f7cfb4ad741 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 30 Jun 2017 21:09:34 +0000 Subject: [PATCH] [InstCombine] Replace an unnecessary use of a matcher with just an isa and a cast. NFC We aren't looking through any levels of IR here so I don't think we need the power of a matcher or the temporary variable it requires. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306885 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/InstCombine/InstCombineInternal.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Transforms/InstCombine/InstCombineInternal.h b/lib/Transforms/InstCombine/InstCombineInternal.h index 1b0fe84dd4d..87f11467b95 100644 --- a/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/lib/Transforms/InstCombine/InstCombineInternal.h @@ -131,11 +131,10 @@ static inline bool IsFreeToInvert(Value *V, bool WillInvertAllUses) { return true; // A vector of constant integers can be inverted easily. - Constant *CV; - if (V->getType()->isVectorTy() && match(V, PatternMatch::m_Constant(CV))) { + if (V->getType()->isVectorTy() && isa(V)) { unsigned NumElts = V->getType()->getVectorNumElements(); for (unsigned i = 0; i != NumElts; ++i) { - Constant *Elt = CV->getAggregateElement(i); + Constant *Elt = cast(V)->getAggregateElement(i); if (!Elt) return false; -- 2.40.0