Skip to content

Commit

Permalink
[X86] combineBitcast - merge isa<>/cast<> into single dyn_cast<> call…
Browse files Browse the repository at this point in the history
…. NFC.
  • Loading branch information
RKSimon committed May 22, 2024
1 parent 0748a98 commit cdcd653
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43694,14 +43694,14 @@ static SDValue combineBitcast(SDNode *N, SelectionDAG &DAG,
return combinevXi1ConstantToInteger(N0, DAG);
}

if (Subtarget.hasAVX512() && SrcVT.isScalarInteger() &&
VT.isVector() && VT.getVectorElementType() == MVT::i1 &&
isa<ConstantSDNode>(N0)) {
auto *C = cast<ConstantSDNode>(N0);
if (C->isAllOnes())
return DAG.getConstant(1, SDLoc(N0), VT);
if (C->isZero())
return DAG.getConstant(0, SDLoc(N0), VT);
if (Subtarget.hasAVX512() && SrcVT.isScalarInteger() && VT.isVector() &&
VT.getVectorElementType() == MVT::i1) {
if (auto *C = dyn_cast<ConstantSDNode>(N0)) {
if (C->isAllOnes())
return DAG.getConstant(1, SDLoc(N0), VT);
if (C->isZero())
return DAG.getConstant(0, SDLoc(N0), VT);
}
}

// Look for MOVMSK that is maybe truncated and then bitcasted to vXi1.
Expand Down

0 comments on commit cdcd653

Please sign in to comment.