diff options
| author | Florian Hahn <flo@fhahn.com> | 2026-02-08 11:55:11 +0000 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2026-02-08 11:55:12 +0000 |
| commit | 3192fe2c7b08912cc72c86471a593165b615dc28 (patch) | |
| tree | 88346bf642fa5d8a1d647e79c708b1cd0606d312 /llvm/lib/Transforms/Vectorize | |
| parent | b2f8a0f60134120586865bfb059b52929e6e8a04 (diff) | |
| download | llvm-3192fe2c7b08912cc72c86471a593165b615dc28.tar.gz llvm-3192fe2c7b08912cc72c86471a593165b615dc28.tar.bz2 llvm-3192fe2c7b08912cc72c86471a593165b615dc28.zip | |
[VPlan] Fall back to legacy cost model if PtrSCEV is nullptr.
There are some cases when PtrSCEV can be nullptr. Fall back to legacy
cost model, to not call isLoopInvariant with nullptr.
Fixes a crash after 0c4f8094939d2.
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp index accc4a3fb3ae..eea499aa345a 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp @@ -3523,7 +3523,7 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF, if (ParentRegion && ParentRegion->isReplicator()) { // TODO: Handle loop-invariant pointers in predicated blocks. For now, // fall back to the legacy cost model. - if (Ctx.PSE.getSE()->isLoopInvariant(PtrSCEV, Ctx.L)) + if (!PtrSCEV || Ctx.PSE.getSE()->isLoopInvariant(PtrSCEV, Ctx.L)) break; Cost /= Ctx.getPredBlockCostDivisor(UI->getParent()); Cost += Ctx.TTI.getCFInstrCost(Instruction::Br, Ctx.CostKind); |
