As the existing test unreachable.ll shows, we should be doing more
work to avoid entering unreachable blocks: we should not stop
vectorization just because a PHI incoming value from an unreachable
block cannot be vectorized. We know that particular value will never
be used so we can just replace it with poison.
Details
Details
- Reviewers
ABataev RKSimon - Commits
- rGf126e8ec2873: [SLPVectorizer] Ignore unreachable blocks
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
2833–2834 | Better to do something like this: if (!DT->isReachableFromEntry(PH->getIncomingBlock(I))) { ValueList Operands(VL.size(), PoisonValue::get(PH->getType())); TE->setOperand(I, Operands); OperandsVec.push_back(Operands); continue; } and remove the change in BoUpSLP::vectorizeTree |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
2833–2834 | Good idea, re-ran tests with exactly what you put here, that works. |
Comment Actions
Thanks. Accidentally pushed without updating the commit message, linking and closing manually.
Better to do something like this:
and remove the change in BoUpSLP::vectorizeTree