This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Verify all IR -> SCEV mappings
ClosedPublic

Authored by nikic on Mar 7 2022, 3:58 AM.

Details

Summary

This extends SCEV verification to check not only backedge-taken counts, but all entries in the IR -> SCEV cache. The restrictions are the same as for the BECount case, i.e. we ignore expressions based on undef, we only diagnose constant deltas (there are way too many false positives otherwise) and we limit to reachable code.

Not entirely sure whether doing this is worthwhile, as it's probably quite expensive, and I didn't catch any new issues in llvm-lit tests / llvm-test-suite at least.

Diff Detail

Event Timeline

nikic created this revision.Mar 7 2022, 3:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 3:58 AM
nikic requested review of this revision.Mar 7 2022, 3:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 3:58 AM
reames accepted this revision.Mar 7 2022, 9:01 AM

I think this is very worthwhile doing under expensive asserts, and probably any time we verify SCEV explicitly. Given that, LGTM

This revision is now accepted and ready to land.Mar 7 2022, 9:01 AM
This revision was landed with ongoing or failed builds.Mar 9 2022, 12:37 AM
This revision was automatically updated to reflect the committed changes.