forked from OSchip/llvm-project
[DAGCombine] Check zext legality in zext-extract-extend combine
Discussed in D131503. Fix to D130782.
This commit is contained in:
parent
94fae7a581
commit
898699831b
|
@ -6378,7 +6378,8 @@ SDValue DAGCombiner::visitAND(SDNode *N) {
|
|||
SDValue Extendee = Ext->getOperand(0);
|
||||
|
||||
unsigned ScalarWidth = Extendee.getValueType().getScalarSizeInBits();
|
||||
if (N1C->getAPIntValue().isMask(ScalarWidth)) {
|
||||
if (N1C->getAPIntValue().isMask(ScalarWidth) &&
|
||||
(!LegalOperations || TLI.isOperationLegal(ISD::ZERO_EXTEND, ExtVT))) {
|
||||
// (and (extract_subvector (zext|anyext|sext v) _) iN_mask)
|
||||
// => (extract_subvector (iN_zeroext v))
|
||||
SDValue ZeroExtExtendee =
|
||||
|
|
Loading…
Reference in New Issue