[X86] 512-bit VPAVG requires AVX512BW

Fix VPAVG detection to require AVX512BW, not AVX512F for 512-bit widths,
and change associated asserts to assert in the right direction...

This fixes PR29111.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279755 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael Kuperstein 2016-08-25 17:17:46 +00:00
parent 0913709212
commit 59f7ccfe10
2 changed files with 1763 additions and 57 deletions

View File

@ -22170,9 +22170,9 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
auto InVTSize = InVT.getSizeInBits();
const unsigned RegSize =
(InVTSize > 128) ? ((InVTSize > 256) ? 512 : 256) : 128;
assert((!Subtarget.hasAVX512() || RegSize < 512) &&
"512-bit vector requires AVX512");
assert((!Subtarget.hasAVX2() || RegSize < 256) &&
assert((Subtarget.hasBWI() || RegSize < 512) &&
"512-bit vector requires AVX512BW");
assert((Subtarget.hasAVX2() || RegSize < 256) &&
"256-bit vector requires AVX2");
auto ElemVT = InVT.getVectorElementType();
@ -29233,7 +29233,7 @@ static SDValue detectAVGPattern(SDValue In, EVT VT, SelectionDAG &DAG,
if (!Subtarget.hasSSE2())
return SDValue();
if (Subtarget.hasAVX512()) {
if (Subtarget.hasBWI()) {
if (VT.getSizeInBits() > 512)
return SDValue();
} else if (Subtarget.hasAVX2()) {

File diff suppressed because it is too large Load Diff