forked from OSchip/llvm-project
[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:
parent
05594de2d7
commit
95f9eddbbc
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue