[X86] EltsFromConsecutiveLoads - cleanup Zero/Undef/Load element collection. NFCI.

llvm-svn: 365628
This commit is contained in:
Simon Pilgrim 2019-07-10 13:28:13 +00:00
parent 7d0778ea6b
commit 0a9479ef39
1 changed files with 17 additions and 12 deletions

View File

@ -7525,21 +7525,26 @@ static SDValue EltsFromConsecutiveLoads(EVT VT, ArrayRef<SDValue> Elts,
SDValue Elt = peekThroughBitcasts(Elts[i]);
if (!Elt.getNode())
return SDValue();
if (Elt.isUndef())
if (Elt.isUndef()) {
UndefMask.setBit(i);
else if (X86::isZeroNode(Elt) || ISD::isBuildVectorAllZeros(Elt.getNode()))
continue;
}
if (X86::isZeroNode(Elt) || ISD::isBuildVectorAllZeros(Elt.getNode())) {
ZeroMask.setBit(i);
else if (ISD::isNON_EXTLoad(Elt.getNode())) {
Loads[i] = cast<LoadSDNode>(Elt);
LoadMask.setBit(i);
LastLoadedElt = i;
// Each loaded element must be the correct fractional portion of the
// requested vector load.
if ((NumElems * Elt.getValueSizeInBits()) != VT.getSizeInBits())
return SDValue();
} else
continue;
}
// Each loaded element must be the correct fractional portion of the
// requested vector load.
if ((NumElems * Elt.getValueSizeInBits()) != VT.getSizeInBits())
return SDValue();
if (!ISD::isNON_EXTLoad(Elt.getNode()))
return SDValue();
Loads[i] = cast<LoadSDNode>(Elt);
LoadMask.setBit(i);
LastLoadedElt = i;
}
assert((ZeroMask.countPopulation() + UndefMask.countPopulation() +
LoadMask.countPopulation()) == NumElems &&