File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -20492,9 +20492,11 @@ SDValue DAGCombiner::replaceStoreOfInsertLoad(StoreSDNode *ST) {
20492
20492
SDValue Elt = Value.getOperand(1);
20493
20493
SDValue Idx = Value.getOperand(2);
20494
20494
20495
- // If the element isn't byte sized then we can't compute an offset
20495
+ // If the element isn't byte sized or is implicitly truncated then we can't
20496
+ // compute an offset.
20496
20497
EVT EltVT = Elt.getValueType();
20497
- if (!EltVT.isByteSized())
20498
+ if (!EltVT.isByteSized() ||
20499
+ EltVT != Value.getOperand(0).getValueType().getVectorElementType())
20498
20500
return SDValue();
20499
20501
20500
20502
auto *Ld = dyn_cast<LoadSDNode>(Value.getOperand(0));
Original file line number Diff line number Diff line change @@ -41,7 +41,16 @@ define void @f(ptr %0) {
41
41
;
42
42
; AVX512-LABEL: f:
43
43
; AVX512: # %bb.0:
44
- ; AVX512-NEXT: movb $1, 1(%rdi)
44
+ ; AVX512-NEXT: kmovb (%rdi), %k0
45
+ ; AVX512-NEXT: movb $-3, %al
46
+ ; AVX512-NEXT: kmovd %eax, %k1
47
+ ; AVX512-NEXT: kandb %k1, %k0, %k0
48
+ ; AVX512-NEXT: movb $1, %al
49
+ ; AVX512-NEXT: kmovd %eax, %k1
50
+ ; AVX512-NEXT: kshiftlb $7, %k1, %k1
51
+ ; AVX512-NEXT: kshiftrb $6, %k1, %k1
52
+ ; AVX512-NEXT: korb %k1, %k0, %k0
53
+ ; AVX512-NEXT: kmovb %k0, (%rdi)
45
54
; AVX512-NEXT: retq
46
55
%2 = load <8 x i1 >, ptr %0
47
56
%3 = insertelement <8 x i1 > %2 , i1 true , i32 1
You can’t perform that action at this time.
0 commit comments