summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-06-30 21:09:34 +0000
committerCraig Topper <craig.topper@intel.com>2017-06-30 21:09:34 +0000
commitbcf511c0daaa58b940fe4ab22b3048c02052ea7c (patch)
treeabaeeff830fdcdff0acf838ce330a8800d5d42aa /llvm/lib/Transforms/InstCombine/InstCombineInternal.h
parent2ff59d4350ba41837ec583e0ff3a2425e88d2ee4 (diff)
downloadbcm5719-llvm-bcf511c0daaa58b940fe4ab22b3048c02052ea7c.tar.gz
bcm5719-llvm-bcf511c0daaa58b940fe4ab22b3048c02052ea7c.zip
[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. llvm-svn: 306885
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineInternal.h')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineInternal.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
index 1b0fe84dd4d..87f11467b95 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
+++ b/llvm/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<Constant>(V)) {
unsigned NumElts = V->getType()->getVectorNumElements();
for (unsigned i = 0; i != NumElts; ++i) {
- Constant *Elt = CV->getAggregateElement(i);
+ Constant *Elt = cast<Constant>(V)->getAggregateElement(i);
if (!Elt)
return false;
OpenPOWER on IntegriCloud