Skip to content

Commit cbb2b84

Browse files
committed
Fixups
Change-Id: I9a65d3799e0c28460cb0074c5455ef2a81e44cae
1 parent bc04bc2 commit cbb2b84

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3939,6 +3939,7 @@ SDValue DAGTypeLegalizer::SplitVecOp_EXTRACT_SUBVECTOR(SDNode *N) {
39393939
GetSplitVector(N->getOperand(0), Lo, Hi);
39403940

39413941
ElementCount LoElts = Lo.getValueType().getVectorElementCount();
3942+
// Note: For scalable vectors, the index is scaled by vscale.
39423943
ElementCount IdxVal =
39433944
ElementCount::get(Idx->getAsZExtVal(), SubVT.isScalableVector());
39443945
uint64_t IdxValMin = IdxVal.getKnownMinValue();
@@ -3951,8 +3952,8 @@ SDValue DAGTypeLegalizer::SplitVecOp_EXTRACT_SUBVECTOR(SDNode *N) {
39513952
return DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, SubVT, Lo, Idx);
39523953

39533954
unsigned LoEltsMin = LoElts.getKnownMinValue();
3954-
if (IdxValMin < LoEltsMin &&
3955-
!(SubVT.isScalableVector() || SrcVT.isScalableVector())) {
3955+
if (IdxValMin < LoEltsMin && SubVT.isFixedLengthVector() &&
3956+
SrcVT.isFixedLengthVector()) {
39563957
// Extracted subvector crosses vector split, so we need to blend the two
39573958
// halves.
39583959
// TODO: May be able to emit partial extract_subvector.

0 commit comments

Comments
 (0)