[PATCH] D127288: [IndVarSimplify] Don't assert that terminator is not SCEVable (PR55925)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 03:56:08 PDT 2022


nikic created this revision.
nikic added reviewers: fhahn, reames, mkazantsev, SjoerdMeijer.
Herald added subscribers: javed.absar, hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The IV widening code currently asserts that terminators aren't SCEVable -- however, this is not the case for invokes with a returned attribute.

As far as I can tell, this assertions is not necessary -- even if we have a critical edge (the second test case), the trunc gets inserted in a legal position. Though I would be happy to instead bail out for the terminator case, as it's something of an edge case, and I don't think the transform is profitable for it anyway.

Fixes https://github.com/llvm/llvm-project/issues/55925.


https://reviews.llvm.org/D127288

Files:
  llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
  llvm/test/Transforms/IndVarSimplify/pr55925.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127288.435095.patch
Type: text/x-patch
Size: 4431 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220608/286a44a0/attachment.bin>


More information about the llvm-commits mailing list