[PATCH] D128033: [LoopVectorize] Fix createInductionResumeValues

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 17 00:08:38 PDT 2022


skatkov created this revision.
skatkov added reviewers: fhahn, david-arm.
Herald added subscribers: javed.absar, hiraditya.
Herald added a project: All.
skatkov requested review of this revision.
Herald added a project: LLVM.

createInductionResumeValues creates a phi node placeholder without filling incoming values.
Then it generates the incoming values. It includes triggering of SCEV expanded which may invoke SSAUpdater.
SSAUpdater has an optimization to detect number of predecessors basing on number of incoming values
if there is phi node. In case phi node is not filled with incoming values - the number of predecessors detected as 0
and this leads to segmentation fault.

In other words SSAUpdater that IT is in good shape while LoopVectorizer breaks this requirement.
The fix is just prepare all incoming values first and then build a phi node.


https://reviews.llvm.org/D128033

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/create-induction-resume.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128033.437805.patch
Type: text/x-patch
Size: 7073 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220617/855f434b/attachment.bin>


More information about the llvm-commits mailing list