Skip to content

Commit ae31132

Browse files
committed
fixup! Address reviewer comments
1 parent 9fd8830 commit ae31132

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

llvm/lib/CodeGen/InterleavedAccessPass.cpp

+5-10
Original file line numberDiff line numberDiff line change
@@ -249,22 +249,17 @@ static bool isReInterleaveMask(ShuffleVectorInst *SVI, unsigned &Factor,
249249
return false;
250250
}
251251

252-
/// Return true if it's a non-all-zeros, interleaving mask. For instance,
253-
/// 111000111000 is interleaved from three 1010 masks.
254-
/// \p SubMask returns the mask of individual lane.
252+
/// Return true if it's an interleaving mask. For instance, 111000111000 is
253+
/// interleaved from three 1010 masks. \p SubMask returns the mask of individual
254+
/// lane.
255255
static bool isInterleavedConstantMask(unsigned Factor, ConstantVector *Mask,
256256
SmallVectorImpl<Constant *> &LaneMask) {
257257
unsigned LaneMaskLen = LaneMask.size();
258258
if (auto *Splat = Mask->getSplatValue()) {
259-
// All-zeros mask.
260-
if (Splat->isZeroValue())
261-
return false;
262-
// All-ones mask.
263-
std::fill(LaneMask.begin(), LaneMask.end(),
264-
ConstantInt::getTrue(Mask->getContext()));
259+
std::fill(LaneMask.begin(), LaneMask.end(), Splat);
265260
} else {
266261
for (unsigned Idx = 0U, N = LaneMaskLen * Factor; Idx < N; ++Idx) {
267-
Constant *Ref = Mask->getAggregateElement((Idx / Factor) * Factor);
262+
Constant *Ref = Mask->getAggregateElement(alignDown(Idx, Factor));
268263
if (Ref != Mask->getAggregateElement(Idx))
269264
return false;
270265
LaneMask[Idx / Factor] = Ref;

0 commit comments

Comments
 (0)