Skip to content

Commit 6dc716d

Browse files
committed
Add more specific asserts, remove if condition
1 parent 01dad11 commit 6dc716d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,15 +937,16 @@ std::vector<Chain> Vectorizer::splitChainByAlignment(Chain &C) {
937937
// the next power-of-2
938938
Chain ExtendingLoadsStores;
939939
if (NumVecElems < TargetVF && !isPowerOf2_32(NumVecElems) &&
940-
VecElemBits >= 8 && isPowerOf2_32(TargetVF)) {
940+
VecElemBits >= 8) {
941941
// TargetVF may be a lot higher than NumVecElems,
942942
// so only extend to the next power of 2.
943943
assert(VecElemBits % 8 == 0);
944944
unsigned VecElemBytes = VecElemBits / 8;
945945
unsigned NewNumVecElems = PowerOf2Ceil(NumVecElems);
946946
unsigned NewSizeBytes = VecElemBytes * NewNumVecElems;
947947

948-
assert(NewNumVecElems <= TargetVF);
948+
assert(isPowerOf2_32(TargetVF) && "TargetVF expected to be a power of 2");
949+
assert(NewNumVecElems <= TargetVF && "Should not extend past TargetVF");
949950

950951
LLVM_DEBUG(dbgs() << "LSV: attempting to extend chain of "
951952
<< NumVecElems << " "

0 commit comments

Comments
 (0)