[X86] Avoid folding scalar loads into unary sse intrinsics
authorMichael Kuperstein <michael.m.kuperstein@intel.com>
Thu, 31 Dec 2015 09:45:16 +0000 (09:45 +0000)
committerMichael Kuperstein <michael.m.kuperstein@intel.com>
Thu, 31 Dec 2015 09:45:16 +0000 (09:45 +0000)
commitd36e24a1662aa539315651d66ed0698a9e0f81f8
tree65d4a855e410a4c289c132702d897d0ec6d97345
parentaf6569afd23bb0bbf1ae6c6a9eaa3a274ff5a853
[X86] Avoid folding scalar loads into unary sse intrinsics

Not folding these cases tends to avoid partial register updates:
sqrtss (%eax), %xmm0
Has a partial update of %xmm0, while
movss (%eax), %xmm0
sqrtss %xmm0, %xmm0
Has a clobber of the high lanes immediately before the partial update,
avoiding a potential stall.

Given this, we only want to fold when optimizing for size.
This is consistent with the patterns we already have for some of
the fp/int converts, and in X86InstrInfo::foldMemoryOperandImpl()

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

llvm-svn: 256671
llvm/lib/Target/X86/X86InstrSSE.td
llvm/test/CodeGen/X86/fold-load-unops.ll