summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-07-10 13:28:13 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-07-10 13:28:13 +0000
commit0a9479ef3946d92e7f533a7920ea2fdef2ada7ed (patch)
tree38d6b003dd47c906a37077ae7d1144ee6553c8ae /llvm/lib/Target
parent7d0778ea6bce7caaf9651abe21e784019f04f44d (diff)
downloadbcm5719-llvm-0a9479ef3946d92e7f533a7920ea2fdef2ada7ed.tar.gz
bcm5719-llvm-0a9479ef3946d92e7f533a7920ea2fdef2ada7ed.zip
[X86] EltsFromConsecutiveLoads - cleanup Zero/Undef/Load element collection. NFCI.
llvm-svn: 365628
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index a33bf07cd72..de556ed8433 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -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 &&
OpenPOWER on IntegriCloud