Skip to content

Commit 32ef01e

Browse files
author
Mikhail Gudim
committed
correct Alignment passed to isStridedLoad
1 parent 97eb9ed commit 32ef01e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6948,7 +6948,10 @@ BoUpSLP::LoadsState BoUpSLP::canVectorizeLoads(
69486948
cast<Instruction>(V), UserIgnoreList);
69496949
}))
69506950
return LoadsState::CompressVectorize;
6951-
if (isStridedLoad(PointerOps, ScalarTy, CommonAlignment, *Diff, Ptr0, PtrN,
6951+
Align Alignment =
6952+
cast<LoadInst>(Order.empty() ? VL.front() : VL[Order.front()])
6953+
->getAlign();
6954+
if (isStridedLoad(PointerOps, ScalarTy, Alignment, *Diff, Ptr0, PtrN,
69526955
SPtrInfo))
69536956
return LoadsState::StridedVectorize;
69546957
}

0 commit comments

Comments
 (0)