diff --git a/lib/Transforms/Vectorize/VecUtils.cpp b/lib/Transforms/Vectorize/VecUtils.cpp index 16189860420..3db4adf95c8 100644 --- a/lib/Transforms/Vectorize/VecUtils.cpp +++ b/lib/Transforms/Vectorize/VecUtils.cpp @@ -141,9 +141,11 @@ bool BoUpSLP::vectorizeStoreChain(ArrayRef Chain, int CostThreshold) { } } - if (Changed) - return true; + if (Changed || ChainLen > VF) + return Changed; + // Handle short chains. This helps us catch types such as <3 x float> that + // are smaller than vector size. int Cost = getTreeCost(Chain); if (Cost < CostThreshold) { DEBUG(dbgs() << "SLP: Found store chain cost = " << Cost