[X86] Teach load folding to accept scalar _Int users of MOVSS/MOVSD.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 22 Jun 2015 20:51:51 +0000 (20:51 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 22 Jun 2015 20:51:51 +0000 (20:51 +0000)
commita3afb70a5dd1a7bb8e14f46edf6713f2de056d45
tree30313dbf423dbce9a566fd02b8497c65f3683563
parentf654cdae59a71576b4da603c44ea78e24fe3a2a4
[X86] Teach load folding to accept scalar _Int users of MOVSS/MOVSD.

The _Int instructions are special, in that they operate on the full
VR128 instead of FR32.  The load folding then looks at MOVSS, at the
user, and bails out when it sees a size mismatch.

What we really know is that the rm_Int instructions don't load the
higher lanes, so folding is fine.

This happens for the straightforward intrinsic code, e.g.:

    _mm_add_ss(a, _mm_load_ss(p));

Fixes PR23349.

Differential Revision: http://reviews.llvm.org/D10554

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240326 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrInfo.cpp
test/CodeGen/X86/fold-load-binops.ll [new file with mode: 0644]