This is an archive of the discontinued LLVM Phabricator instance.

[LoopFlatten] Fix bug where SCEVCouldNotCompute object is used
ClosedPublic

Authored by RosieSumpter on Jul 28 2021, 8:45 AM.

Details

Summary

The SCEV method getBackedgeTakenCount() returns a SCEVCouldNotCompute
object if the backedge-taken count is unpredictable. This fix ensures
there is no longer an attempt to use such an object to find the trip
count.

Diff Detail

Event Timeline

RosieSumpter created this revision.Jul 28 2021, 8:45 AM
RosieSumpter requested review of this revision.Jul 28 2021, 8:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2021, 8:45 AM
SjoerdMeijer accepted this revision.Jul 28 2021, 8:55 AM

Looks like a good fix to me.

This revision is now accepted and ready to land.Jul 28 2021, 8:55 AM

Perhaps the test case could be reduced, but I am happy to get a fix in first and look at the test as a follow up (if needed).