As the tests show, using cst_pred_ty in the definition allows us to match vectors with undef elements.
This appears to do what I was hoping for with maximal reuse of the existing code, but my grasp of C++ templates is too weak to know if I've broken any laws here.
My initial patch just replaced the lines in the existing not_match struct like this:
-- if (isAllOnes(O->getOperand(1)) ++ if (m_AllOnes().match(O->getOperand(1)))
...and that seems to work too, but this way removes more code (assuming it's ok).
This is a continuation to make all pattern matchers allow undef elements in vectors:
https://reviews.llvm.org/rL325437
https://reviews.llvm.org/rL325466
D43792