[X86] Require 32-byte alignment for 32-byte VMOVNTs.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 2 Sep 2015 23:25:39 +0000 (23:25 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 2 Sep 2015 23:25:39 +0000 (23:25 +0000)
commit1522e8d8f8e577e23a4b4d166e89a6cb131b479a
tree8566ba67079472196bd779bcbc0f684d0a21596e
parentaa603526a1a12c13d05121552ccf7c1aae481bdf
[X86] Require 32-byte alignment for 32-byte VMOVNTs.

We used to accept (and even test, and generate) 16-byte alignment
for 32-byte nontemporal stores, but they require 32-byte alignment,
per SDM. Found by inspection.

Instead of hardcoding 16 in the patfrag, check for natural alignment.
Also fix the autoupgrade and the various tests.

Also, use explicit -mattr instead of -mcpu: I stared at the output
several minutes wondering why I get 2x movntps for the unaligned
case (which is the ideal output, but needs some work: see FIXME),
until I remembered corei7-avx implies +slow-unaligned-mem-32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246733 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/AutoUpgrade.cpp
lib/Target/X86/X86InstrFragmentsSIMD.td
test/CodeGen/X86/avx2-nontemporal.ll
test/CodeGen/X86/movntdq-no-avx.ll
test/CodeGen/X86/nontemporal-2.ll