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) {
952
952
if (!IsConst0 && !IsConst1 && Index0 != Index1)
953
953
return false ;
954
954
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
+
955
961
// Bail for single insertion if it is a load.
956
962
// TODO: Handle this once getVectorInstrCost can cost for load/stores.
957
963
auto *I0 = dyn_cast_or_null<Instruction>(V0);
Original file line number Diff line number Diff line change 4
4
define <2 x i8 > @PR115575 (i8 %x ) {
5
5
; CHECK-LABEL: define <2 x i8> @PR115575(
6
6
; 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>
9
9
; CHECK-NEXT: ret <2 x i8> [[BO]]
10
10
;
11
11
%ins = insertelement <2 x i8 > poison, i8 %x , i32 3
You can’t perform that action at this time.
0 commit comments