[IR] Fix UB on Op<2> in ShuffleVector predicates (#75549)

This Op<2> usage was missed in 1ee6ec2bf3, which replaced the third
shuffle operand with a vector of integer mask constants.

I noticed this when attempting to make changes to the layout of
llvm::Value.
This commit is contained in:
Reid Kleckner 2023-12-15 08:20:03 -08:00 committed by GitHub
parent 414d27419f
commit 04b8c830d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2412,9 +2412,6 @@ bool ShuffleVectorInst::isInsertSubvectorMask(ArrayRef<int> Mask,
}
bool ShuffleVectorInst::isIdentityWithPadding() const {
if (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()))
@ -2439,9 +2436,6 @@ bool ShuffleVectorInst::isIdentityWithPadding() const {
}
bool ShuffleVectorInst::isIdentityWithExtract() const {
if (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()))
@ -2457,8 +2451,7 @@ bool ShuffleVectorInst::isIdentityWithExtract() const {
bool ShuffleVectorInst::isConcat() const {
// Vector concatenation is differentiated from identity with padding.
if (isa<UndefValue>(Op<0>()) || isa<UndefValue>(Op<1>()) ||
isa<UndefValue>(Op<2>()))
if (isa<UndefValue>(Op<0>()) || isa<UndefValue>(Op<1>()))
return false;
// FIXME: Not currently possible to express a shuffle mask for a scalable