[x86][FastISel] Teach how to select nontemporal stores.
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 14 Oct 2015 10:03:13 +0000 (10:03 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 14 Oct 2015 10:03:13 +0000 (10:03 +0000)
commit6cb6b24b788cd250923fd569e38c73248adb8830
treef2f12db2d805a1a29686270528679434e6738f90
parent8f0bf9255c92d247a51f51b34925b16d8066e114
[x86][FastISel] Teach how to select nontemporal stores.

This patch teaches x86 fast-isel how to select nontemporal stores.

On x86, we can use MOVNTI for nontemporal stores of doublewords/quadwords.
Instructions (V)MOVNTPS/PD/DQ can be used for SSE2/AVX aligned nontemporal
vector stores.

Before this patch, fast-isel always selected 'movd/movq' instead of 'movnti'
for doubleword/quadword nontemporal stores. In the case of nontemporal stores
of aligned vectors, fast-isel always selected movaps/movapd/movdqa instead of
movntps/movntpd/movntdq.

With this patch, if we use SSE2/AVX intrinsics for nontemporal stores we now
always get the expected (V)MOVNT instructions.
The lack of fast-isel support for nontemporal stores was spotted when analyzing
the -O0 codegen for nontemporal stores.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250285 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FastISel.cpp
test/CodeGen/X86/fast-isel-nontemporal.ll [new file with mode: 0644]