Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55331,14 +55331,15 @@ static SDValue combineExtSetcc(SDNode *N, SelectionDAG &DAG,
if (Size > 256 && Subtarget.useAVX512Regs())
return SDValue();

EVT N00VT = N0.getOperand(0).getValueType();

// Don't fold if the condition code can't be handled by PCMPEQ/PCMPGT since
// that's the only integer compares with we have.
ISD::CondCode CC = cast<CondCodeSDNode>(N0.getOperand(2))->get();
if (ISD::isUnsignedIntSetCC(CC))
if (N00VT.isInteger() && ISD::isUnsignedIntSetCC(CC))
return SDValue();

// Only do this combine if the extension will be fully consumed by the setcc.
EVT N00VT = N0.getOperand(0).getValueType();
EVT MatchingVecType = N00VT.changeVectorElementTypeToInteger();
if (Size != MatchingVecType.getSizeInBits())
return SDValue();
Expand Down
12 changes: 4 additions & 8 deletions llvm/test/CodeGen/X86/v8i1-masks.ll
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,17 @@ define void @neg_masks(ptr %a, ptr %b, ptr %c) nounwind uwtable noinline ssp {
; X86-AVX512-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-AVX512-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-AVX512-NEXT: vmovups (%ecx), %ymm0
; X86-AVX512-NEXT: vcmpnltps (%eax), %ymm0, %k1
; X86-AVX512-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
; X86-AVX512-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
; X86-AVX512-NEXT: vpsrld $31, %ymm0, %ymm0
; X86-AVX512-NEXT: vcmpnltps (%eax), %ymm0, %ymm0
; X86-AVX512-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}{1to8}, %ymm0, %ymm0
; X86-AVX512-NEXT: vmovdqa %ymm0, (%eax)
; X86-AVX512-NEXT: vzeroupper
; X86-AVX512-NEXT: retl
;
; X64-AVX512-LABEL: neg_masks:
; X64-AVX512: ## %bb.0:
; X64-AVX512-NEXT: vmovups (%rsi), %ymm0
; X64-AVX512-NEXT: vcmpnltps (%rdi), %ymm0, %k1
; X64-AVX512-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
; X64-AVX512-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
; X64-AVX512-NEXT: vpsrld $31, %ymm0, %ymm0
; X64-AVX512-NEXT: vcmpnltps (%rdi), %ymm0, %ymm0
; X64-AVX512-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm0
; X64-AVX512-NEXT: vmovdqa %ymm0, (%rax)
; X64-AVX512-NEXT: vzeroupper
; X64-AVX512-NEXT: retq
Expand Down