This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Add two tests showing the bug in SCEV getAddExpr
AbandonedPublic

Authored by skatkov on Jul 27 2021, 12:26 AM.

Details

Summary

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.

Diff Detail

Event Timeline

skatkov created this revision.Jul 27 2021, 12:26 AM
skatkov requested review of this revision.Jul 27 2021, 12:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2021, 12:26 AM
mkazantsev accepted this revision.Sep 10 2021, 1:24 AM

It makes sense to file a bug (if not already) and describe what the bug is, and then rename the test file into pr<ID>.ll.
Do you really need an approval to check in the tests? :)

This revision is now accepted and ready to land.Sep 10 2021, 1:24 AM

FYI, I landed some tests for this in 248e430f37. Not sure if these are worth keeping or not.

skatkov abandoned this revision.Sep 15 2021, 8:11 PM

Abandon in favor of Philip's tests.