[X86][MMX] Fix folding of shift value loads to cover whole 64-bits
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 13 Mar 2017 21:23:29 +0000 (21:23 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 13 Mar 2017 21:23:29 +0000 (21:23 +0000)
commit8879a17087710c7666df95dd073cd09019d5bcff
tree126583a72f7eb911ec11e73fc85f079ee58f3ff8
parent6ac2f2bb7fc1533420d1c03c5ed6b8ac392daa49
[X86][MMX] Fix folding of shift value loads to cover whole 64-bits

rL230225 made the assumption that only the lower 32-bits of an MMX register load is used as a shift value, when in fact the whole 64-bits are reloaded and treated as a i64 to determine the shift value.

This patch reverts rL230225 to ensure that the whole 64-bits of memory are folded and ensures that the upper 32-bit are zero'd for cases where the shift value has come from a scalar source.

Found during fuzz testing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297667 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrFragmentsSIMD.td
lib/Target/X86/X86InstrMMX.td
test/CodeGen/X86/bitcast-mmx.ll
test/CodeGen/X86/mmx-fold-load.ll