Skip to content

Commit 17e9bec

Browse files
committed
fixup! Address review comments
1 parent 53fe83e commit 17e9bec

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

llvm/lib/CodeGen/InterleavedAccessPass.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ static std::pair<Value *, APInt> getMask(Value *WideMask, unsigned Factor,
599599
F && F == Factor) {
600600
Value *RefArg = nullptr;
601601
// Check if all the intrinsic arguments are the same, except those that
602-
// are zeros, which we mark them as gaps in the gap mask.
602+
// are zeros, which we mark as gaps in the gap mask.
603603
for (auto [Idx, Arg] : enumerate(IMI->args())) {
604604
if (auto *C = dyn_cast<Constant>(Arg); C && C->isZeroValue()) {
605605
GapMask.clearBit(Idx);
@@ -608,15 +608,16 @@ static std::pair<Value *, APInt> getMask(Value *WideMask, unsigned Factor,
608608

609609
if (!RefArg)
610610
RefArg = Arg;
611-
612-
if (RefArg != Arg)
611+
else if (RefArg != Arg)
613612
return {nullptr, GapMask};
614613
}
615614

616615
// In a very rare occasion, all the intrinsic arguments might be zeros,
617616
// in which case we still want to return an all-zeros constant instead of
618-
// nullptr, so we're not using RefArg here.
619-
return {IMI->getArgOperand(0), GapMask};
617+
// nullptr.
618+
return {RefArg ? RefArg
619+
: Constant::getNullValue(IMI->getArgOperand(0)->getType()),
620+
GapMask};
620621
}
621622
}
622623

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-interleaved-access.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ define {<4 x i32>, <4 x i32>} @vpload_factor2_interleaved_mask_intrinsic(ptr %pt
205205
ret {<4 x i32>, <4 x i32>} %res1
206206
}
207207

208+
; mask = %m, skip the last two fields.
208209
define {<2 x i32>, <2 x i32>} @vpload_factor4_interleaved_mask_intrinsic_skip_fields(ptr %ptr, <2 x i1> %m) {
209-
; mask = %m, skip the last two fields.
210210
; CHECK-LABEL: vpload_factor4_interleaved_mask_intrinsic_skip_fields:
211211
; CHECK: # %bb.0:
212212
; CHECK-NEXT: li a1, 16

0 commit comments

Comments
 (0)