[X86] Replace (32/64 - n) shift amounts with (neg n) since the shift amount is masked in hardware

Inspired by what AArch64 does for shifts, this patch attempts to replace shift amounts with neg if we can.

This is done directly as part of isel so its as late as possible to avoid breaking some BZHI patterns since those patterns need an unmasked (32-n) to be correct.

To avoid manual load folding and custom instruction selection for the negate. I've inserted new nodes in the DAG above the shift node in topological order.

Differential Revision: https://reviews.llvm.org/D48789

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