[X86] combineSetCCMOVMSK - use APInt::getLowBitsSet to create bitmask. NFC.

SelectionDAG::getConstant creates an APInt internally anyway, and getLowBitsSet helps assert for legal bitwidths. Plus it silences static analyzer out-of-bounds shift warnings.
This commit is contained in:
Simon Pilgrim 2022-01-04 16:56:33 +00:00
parent 05594de2d7
commit 95f9eddbbc
1 changed files with 1 additions and 1 deletions

View File

@ -44117,7 +44117,7 @@ static SDValue combineSetCCMOVMSK(SDValue EFLAGS, X86::CondCode &CC,
BCNumEltBits > NumEltBits &&
DAG.ComputeNumSignBits(BC) > (BCNumEltBits - NumEltBits)) {
SDLoc DL(EFLAGS);
unsigned CmpMask = IsAnyOf ? 0 : ((1 << BCNumElts) - 1);
APInt CmpMask = APInt::getLowBitsSet(32, IsAnyOf ? 0 : BCNumElts);
return DAG.getNode(X86ISD::CMP, DL, MVT::i32,
DAG.getNode(X86ISD::MOVMSK, DL, MVT::i32, BC),
DAG.getConstant(CmpMask, DL, MVT::i32));