[X86] Don't mutate shuffle arguments after early-out for AVX512

The match* functions have the annoying behavior of modifying its inputs.
Save and restore the inputs, just in case the early out for AVX512 is
hit. This is still not great and its only a matter of time this kind of
bug happens again, but I couldn't come up with a better pattern without
rewriting significant chunks of this code. Fixes PR35977.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322644 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed