[X86] combineSetCCMOVMSK - consistently use CmpBits variable. NFCI.

The comparison value should be the same size - I've added an assert to be absolutely certain.
This commit is contained in:
Simon Pilgrim 2020-06-20 12:35:24 +01:00
parent 56a9332328
commit 89dcbdfcfd
1 changed files with 2 additions and 1 deletions

View File

@ -40518,6 +40518,7 @@ static SDValue combineSetCCMOVMSK(SDValue EFLAGS, X86::CondCode &CC,
SDValue CmpOp = EFLAGS.getOperand(0);
unsigned CmpBits = CmpOp.getValueSizeInBits();
assert(CmpBits == CmpVal.getBitWidth() && "Value size mismatch");
// Peek through any truncate.
if (CmpOp.getOpcode() == ISD::TRUNCATE)
@ -40535,7 +40536,7 @@ static SDValue combineSetCCMOVMSK(SDValue EFLAGS, X86::CondCode &CC,
unsigned NumEltBits = VecVT.getScalarSizeInBits();
bool IsAnyOf = CmpOpcode == X86ISD::CMP && CmpVal.isNullValue();
bool IsAllOf = CmpOpcode == X86ISD::SUB && NumElts <= CmpVal.getBitWidth() &&
bool IsAllOf = CmpOpcode == X86ISD::SUB && NumElts <= CmpBits &&
CmpVal.isMask(NumElts);
if (!IsAnyOf && !IsAllOf)
return SDValue();