Skip to content

Commit 54c6e1c

Browse files
committed
[SLP] Move a non-power-of-two bailout down slightly
The first part of CheckForShuffledLoads isn't doing any subvector analysis, so it's perfectly safe for arbitrary VL.
1 parent 60efbe9 commit 54c6e1c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4819,12 +4819,6 @@ BoUpSLP::LoadsState BoUpSLP::canVectorizeLoads(
48194819
// representation is better than just gather.
48204820
auto CheckForShuffledLoads = [&, &TTI = *TTI](Align CommonAlignment,
48214821
bool ProfitableGatherPointers) {
4822-
// FIXME: The following code has not been updated for non-power-of-2
4823-
// vectors. The splitting logic here does not cover the original
4824-
// vector if the vector factor is not a power of two. FIXME
4825-
if (!has_single_bit(VL.size()))
4826-
return false;
4827-
48284822
// Compare masked gather cost and loads + insert subvector costs.
48294823
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
48304824
auto [ScalarGEPCost, VectorGEPCost] =
@@ -4874,6 +4868,13 @@ BoUpSLP::LoadsState BoUpSLP::canVectorizeLoads(
48744868
constexpr unsigned ListLimit = 4;
48754869
if (!TryRecursiveCheck || VL.size() < ListLimit)
48764870
return MaskedGatherCost - GatherCost >= -SLPCostThreshold;
4871+
4872+
// FIXME: The following code has not been updated for non-power-of-2
4873+
// vectors. The splitting logic here does not cover the original
4874+
// vector if the vector factor is not a power of two. FIXME
4875+
if (!has_single_bit(VL.size()))
4876+
return false;
4877+
48774878
unsigned Sz = DL->getTypeSizeInBits(ScalarTy);
48784879
unsigned MinVF = getMinVF(2 * Sz);
48794880
DemandedElts.clearAllBits();

0 commit comments

Comments
 (0)