[PatternMatch] create and use matcher for 'not' that excludes undef elements
authorSanjay Patel <spatel@rotateright.com>
Wed, 1 Dec 2021 22:21:19 +0000 (17:21 -0500)
committerSanjay Patel <spatel@rotateright.com>
Thu, 2 Dec 2021 13:51:13 +0000 (08:51 -0500)
commit97e921c81fbfa75d6863cf08268373983193d420
treee1b17d3dd8931e1e625ae6cde144c51f669b9317
parent9f9e8ba114ce091f375f7ea9316a65c7582d6882
[PatternMatch] create and use matcher for 'not' that excludes undef elements

We needed a stricter version of m_Not for D114462, but I wasn't
sure if that was going to be required anywhere else, so I didn't bother
to make that reusable.

It turns out we have one more existing simplification that needs
this (currently miscompiles):
https://alive2.llvm.org/ce/z/9-nTKi

And there's at least one more fold in that family that we could add.

Differential Revision: https://reviews.llvm.org/D114882
llvm/include/llvm/IR/PatternMatch.h
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/unittests/IR/PatternMatch.cpp