[X86] Sign extend the 8-bit immediate when commuting blend instructions to match...
authorCraig Topper <craig.topper@intel.com>
Sat, 23 Feb 2019 08:34:10 +0000 (08:34 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 23 Feb 2019 08:34:10 +0000 (08:34 +0000)
commit75afc0105c089171f9d85d59038617fb222c38cd
tree568cdcd8058cc08c4fcaf8865a918edc582ffcee
parent6f1268a4ccad108bd478d520e2cd647d709a297b
[X86] Sign extend the 8-bit immediate when commuting blend instructions to match isel.

Conversion from ConstantSDNode to MachineInstr sign extends immediates from their APInt representation to int64_t.

This commit makes sure we do the same for commuting. The tests changes show how this improves CSE. This issue was made worse by the MachineCSE using commuteInstruction to undo a commute. So we virtually guarantee the sign extend from isel would be lost.

The improved CSE also occurred with r354363, but that was reverted. I'm working to undo the revert, but wanted to get this fix in while it was easy to see the results.

llvm-svn: 354724
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/test/CodeGen/X86/masked_load.ll
llvm/test/CodeGen/X86/masked_store.ll