Skip to content

Commit 04b8c83

Browse files
authored
[IR] Fix UB on Op<2> in ShuffleVector predicates (#75549)
This Op<2> usage was missed in 1ee6ec2, 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.
1 parent 414d274 commit 04b8c83

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

llvm/lib/IR/Instructions.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,9 +2412,6 @@ bool ShuffleVectorInst::isInsertSubvectorMask(ArrayRef<int> Mask,
24122412
}
24132413

24142414
bool ShuffleVectorInst::isIdentityWithPadding() const {
2415-
if (isa<UndefValue>(Op<2>()))
2416-
return false;
2417-
24182415
// FIXME: Not currently possible to express a shuffle mask for a scalable
24192416
// vector for this case.
24202417
if (isa<ScalableVectorType>(getType()))
@@ -2439,9 +2436,6 @@ bool ShuffleVectorInst::isIdentityWithPadding() const {
24392436
}
24402437

24412438
bool ShuffleVectorInst::isIdentityWithExtract() const {
2442-
if (isa<UndefValue>(Op<2>()))
2443-
return false;
2444-
24452439
// FIXME: Not currently possible to express a shuffle mask for a scalable
24462440
// vector for this case.
24472441
if (isa<ScalableVectorType>(getType()))
@@ -2457,8 +2451,7 @@ bool ShuffleVectorInst::isIdentityWithExtract() const {
24572451

24582452
bool ShuffleVectorInst::isConcat() const {
24592453
// Vector concatenation is differentiated from identity with padding.
2460-
if (isa<UndefValue>(Op<0>()) || isa<UndefValue>(Op<1>()) ||
2461-
isa<UndefValue>(Op<2>()))
2454+
if (isa<UndefValue>(Op<0>()) || isa<UndefValue>(Op<1>()))
24622455
return false;
24632456

24642457
// FIXME: Not currently possible to express a shuffle mask for a scalable

0 commit comments

Comments
 (0)