[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
This commit is contained in:
parent
2ff59d4350
commit
bcf511c0da
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue