Skip to content

Commit cdcd653

Browse files
committed
[X86] combineBitcast - merge isa<>/cast<> into single dyn_cast<> call. NFC.
1 parent 0748a98 commit cdcd653

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43694,14 +43694,14 @@ static SDValue combineBitcast(SDNode *N, SelectionDAG &DAG,
4369443694
return combinevXi1ConstantToInteger(N0, DAG);
4369543695
}
4369643696

43697-
if (Subtarget.hasAVX512() && SrcVT.isScalarInteger() &&
43698-
VT.isVector() && VT.getVectorElementType() == MVT::i1 &&
43699-
isa<ConstantSDNode>(N0)) {
43700-
auto *C = cast<ConstantSDNode>(N0);
43701-
if (C->isAllOnes())
43702-
return DAG.getConstant(1, SDLoc(N0), VT);
43703-
if (C->isZero())
43704-
return DAG.getConstant(0, SDLoc(N0), VT);
43697+
if (Subtarget.hasAVX512() && SrcVT.isScalarInteger() && VT.isVector() &&
43698+
VT.getVectorElementType() == MVT::i1) {
43699+
if (auto *C = dyn_cast<ConstantSDNode>(N0)) {
43700+
if (C->isAllOnes())
43701+
return DAG.getConstant(1, SDLoc(N0), VT);
43702+
if (C->isZero())
43703+
return DAG.getConstant(0, SDLoc(N0), VT);
43704+
}
4370543705
}
4370643706

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

0 commit comments

Comments
 (0)