Skip to content

Commit 48aca61

Browse files
committed
[X86] IsElementEquivalent - early-out for non-equivalent bitcasted subelement
1 parent 495673a commit 48aca61

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10000,12 +10000,12 @@ static bool IsElementEquivalent(int MaskSize, SDValue Op, SDValue ExpectedOp,
1000010000
}
1000110001
if ((VT.getScalarSizeInBits() % SrcVT.getScalarSizeInBits()) == 0) {
1000210002
unsigned Scale = VT.getScalarSizeInBits() / SrcVT.getScalarSizeInBits();
10003-
bool AllEquiv = true;
10004-
for (unsigned I = 0; I != Scale && AllEquiv; ++I)
10005-
AllEquiv &=
10006-
IsElementEquivalent(SrcVT.getVectorNumElements(), Src, Src,
10007-
(Idx * Scale) + I, (ExpectedIdx * Scale) + I);
10008-
return AllEquiv;
10003+
for (unsigned I = 0; I != Scale; ++I)
10004+
if (!IsElementEquivalent(SrcVT.getVectorNumElements(), Src, Src,
10005+
(Idx * Scale) + I,
10006+
(ExpectedIdx * Scale) + I))
10007+
return false;
10008+
return true;
1000910009
}
1001010010
}
1001110011
break;

0 commit comments

Comments
 (0)