This is an archive of the discontinued LLVM Phabricator instance.

[x86][FastISel] Teach how to select nontemporal stores.
ClosedPublic

Authored by andreadb on Oct 13 2015, 7:48 AM.

Details

Summary

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.
This patch is a very minor improvement over the existing behavior (at -O0 we probably don't care so much about improving the performance of these stores..).

Please let me know if okay to submit.

Thanks!

Diff Detail

Event Timeline

andreadb updated this revision to Diff 37249.Oct 13 2015, 7:48 AM
andreadb retitled this revision from to [x86][FastISel] Teach how to select nontemporal stores..
andreadb updated this object.
andreadb added reviewers: qcolombet, ributzka.
andreadb added a subscriber: llvm-commits.
qcolombet accepted this revision.Oct 13 2015, 9:56 AM
qcolombet edited edge metadata.

Hi Andrea,

LGTM.

Thanks,
-Quentin

This revision is now accepted and ready to land.Oct 13 2015, 9:56 AM
This revision was automatically updated to reflect the committed changes.