File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
test/Transforms/VectorCombine/X86 Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -952,6 +952,12 @@ bool VectorCombine::scalarizeBinopOrCmp(Instruction &I) {
952952 if (!IsConst0 && !IsConst1 && Index0 != Index1)
953953 return false ;
954954
955+ auto *VecTy0 = cast<VectorType>(Ins0->getType ());
956+ auto *VecTy1 = cast<VectorType>(Ins1->getType ());
957+ if (VecTy0->getElementCount ().getKnownMinValue () <= Index0 ||
958+ VecTy1->getElementCount ().getKnownMinValue () <= Index1)
959+ return false ;
960+
955961 // Bail for single insertion if it is a load.
956962 // TODO: Handle this once getVectorInstrCost can cost for load/stores.
957963 auto *I0 = dyn_cast_or_null<Instruction>(V0);
Original file line number Diff line number Diff line change 44define <2 x i8 > @PR115575 (i8 %x ) {
55; CHECK-LABEL: define <2 x i8> @PR115575(
66; CHECK-SAME: i8 [[X:%.*]]) {
7- ; CHECK-NEXT: [[BO_SCALAR :%.*]] = sdiv i8 [[X]], poison
8- ; CHECK-NEXT: [[BO:%.*]] = insertelement <2 x i8> poison, i8 [[BO_SCALAR ]], i64 3
7+ ; CHECK-NEXT: [[INS :%.*]] = insertelement <2 x i8> poison, i8 [[X]], i32 3
8+ ; CHECK-NEXT: [[BO:%.*]] = sdiv <2 x i8> [[INS ]], <i8 5, i8 2>
99; CHECK-NEXT: ret <2 x i8> [[BO]]
1010;
1111 %ins = insertelement <2 x i8 > poison, i8 %x , i32 3
You can’t perform that action at this time.
0 commit comments