Skip to content

Commit e0a2fbd

Browse files
committed
Mark in planContainsAdditionalSimplifications
This fixes a crash on SPEC CPU 2017 with mismatching legacy + vplan cost models. I'm really struggling to create a test case for this due to the issue at #147038
1 parent bb56e67 commit e0a2fbd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7048,6 +7048,13 @@ static bool planContainsAdditionalSimplifications(VPlan &Plan,
70487048
if (isa<VPPartialReductionRecipe>(&R))
70497049
return true;
70507050

7051+
// VPBlendRecipes are converted to selects and may have been simplified.
7052+
using namespace VPlanPatternMatch;
7053+
if (match(&R, m_VPInstruction<Instruction::Select>(
7054+
m_VPValue(), m_VPValue(), m_VPValue())) &&
7055+
isa_and_nonnull<PHINode>(R.getVPSingleValue()->getUnderlyingValue()))
7056+
return true;
7057+
70517058
/// If a VPlan transform folded a recipe to one producing a single-scalar,
70527059
/// but the original instruction wasn't uniform-after-vectorization in the
70537060
/// legacy cost model, the legacy cost overestimates the actual cost.

0 commit comments

Comments
 (0)