This pattern came up in PR36682:
https://bugs.llvm.org/show_bug.cgi?id=36682
https://godbolt.org/g/LhuD9A
The 'undef' in the vector test is just there to verify a recent improvement in pattern-matching: vector constant matches can include undef elements.