[IR] Bail out for scalable vectors in ShuffleVectorInst::isConcat
Shuffle mask for concat can't be expressed for scalable vectors, so we should bail out. A test has been added that previously crashed, also tested isIdentityWithPadding and isIdentityWithExtract where we already bail out. Reviewed By: sdesmalen Differential Revision: https://reviews.llvm.org/D92475
This commit is contained in:
parent
9b01896555
commit
7b1cb47150
|
@ -2274,6 +2274,11 @@ bool ShuffleVectorInst::isConcat() const {
|
|||
isa<UndefValue>(Op<2>()))
|
||||
return false;
|
||||
|
||||
// FIXME: Not currently possible to express a shuffle mask for a scalable
|
||||
// vector for this case.
|
||||
if (isa<ScalableVectorType>(getType()))
|
||||
return false;
|
||||
|
||||
int NumOpElts = cast<FixedVectorType>(Op<0>()->getType())->getNumElements();
|
||||
int NumMaskElts = cast<FixedVectorType>(getType())->getNumElements();
|
||||
if (NumMaskElts != NumOpElts * 2)
|
||||
|
|
|
@ -1096,6 +1096,17 @@ TEST(InstructionsTest, ShuffleMaskQueries) {
|
|||
EXPECT_TRUE(Id14->changesLength());
|
||||
EXPECT_TRUE(Id14->increasesLength());
|
||||
delete Id14;
|
||||
|
||||
// Not possible to express these masks for scalable vectors, make sure we
|
||||
// don't crash.
|
||||
ShuffleVectorInst *Id15 =
|
||||
new ShuffleVectorInst(Constant::getAllOnesValue(VScaleV2Int32Ty),
|
||||
Constant::getNullValue(VScaleV2Int32Ty),
|
||||
Constant::getNullValue(VScaleV2Int32Ty));
|
||||
EXPECT_FALSE(Id15->isIdentityWithPadding());
|
||||
EXPECT_FALSE(Id15->isIdentityWithExtract());
|
||||
EXPECT_FALSE(Id15->isConcat());
|
||||
delete Id15;
|
||||
}
|
||||
|
||||
TEST(InstructionsTest, GetSplat) {
|
||||
|
|
Loading…
Reference in New Issue