]> granicus.if.org Git - llvm/commitdiff
[X86] Fix a crash if avx512bw and xop are both enabled when the IR contrains a v32i8...
authorCraig Topper <craig.topper@intel.com>
Tue, 5 Dec 2017 04:47:12 +0000 (04:47 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 5 Dec 2017 04:47:12 +0000 (04:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319737 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/vector-bitreverse.ll

index eae3800f86b6894cb62ff75053e4a8b008617600..8e4407438143281b7daa6b34c2884a629aa271cb 100644 (file)
@@ -23792,12 +23792,13 @@ static SDValue LowerBITREVERSE_XOP(SDValue Op, SelectionDAG &DAG) {
 
 static SDValue LowerBITREVERSE(SDValue Op, const X86Subtarget &Subtarget,
                                SelectionDAG &DAG) {
-  if (Subtarget.hasXOP())
+  MVT VT = Op.getSimpleValueType();
+
+  if (Subtarget.hasXOP() && !VT.is512BitVector())
     return LowerBITREVERSE_XOP(Op, DAG);
 
   assert(Subtarget.hasSSSE3() && "SSSE3 required for BITREVERSE");
 
-  MVT VT = Op.getSimpleValueType();
   SDValue In = Op.getOperand(0);
   SDLoc DL(Op);
 
index 0eb3a64311a763bcea08182ad9882104b6542403..51b5219f302430f7e4ef2ea782ae0b5f88319b45 100644 (file)
@@ -8,6 +8,9 @@
 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+xop,+avx | FileCheck %s --check-prefix=ALL --check-prefix=XOP --check-prefix=XOPAVX1
 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+xop,+avx2 | FileCheck %s --check-prefix=ALL --check-prefix=XOP --check-prefix=XOPAVX2
 
+; Make sure we don't crash with avx512bw and xop
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+xop,+avx512bw
+
 define i8 @test_bitreverse_i8(i8 %a) nounwind {
 ; SSE-LABEL: test_bitreverse_i8:
 ; SSE:       # %bb.0: