[PATCH] D106851: [SCEV] Add two tests showing the bug in SCEV getAddExpr

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 27 00:26:12 PDT 2021


skatkov created this revision.
skatkov added reviewers: reames, nikic, efriedma, fhahn, mkazantsev.
Herald added a subscriber: javed.absar.
skatkov requested review of this revision.
Herald added a project: LLVM.

getAddExpr utility uses computed flags from AddRec plus loop invariants
in AddRec.Start + loop invariants basing on the an assumption that
0th iteration of the loop exists. However the loop might be dead
(runtime or compile time), in this case the propagation of the flag becomes
invalid.

One of the test shows the incorrect behavior of IndVarSimplify pass
in case of nested loops.
The second test shows incorrect SCEV computation of sibling loops.

In both cases the right loop is runtime dead and incorrect SCEV is computes
for alive left loop.


https://reviews.llvm.org/D106851

Files:
  llvm/test/Analysis/ScalarEvolution/nuw-add-nested-loops.ll
  llvm/test/Analysis/ScalarEvolution/nuw-add-sibling-loops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106851.361921.patch
Type: text/x-patch
Size: 6209 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210727/a1f25291/attachment-0001.bin>


More information about the llvm-commits mailing list