[InstCombine] use 'match' to simplify code

There's probably some vector-with-undef-element pattern
that shows an improvement, so this is probably not quite
'NFC'.

This is the last step towards removing the fake binop 
queries for not/neg. Ie, there are no more uses of those
functions in trunk. Fneg should follow.

llvm-svn: 345050
This commit is contained in:
Sanjay Patel 2018-10-23 16:54:28 +00:00
parent 3885b49b8e
commit 95790c546f
1 changed files with 1 additions and 1 deletions

View File

@ -141,7 +141,7 @@ static inline Constant *SubOne(Constant *C) {
/// uses of V and only keep uses of ~V.
static inline bool IsFreeToInvert(Value *V, bool WillInvertAllUses) {
// ~(~(X)) -> X.
if (BinaryOperator::isNot(V))
if (match(V, m_Not(m_Value())))
return true;
// Constants can be considered to be not'ed values.