This is an archive of the discontinued LLVM Phabricator instance.

[BasicAA] Remove misleading overflow check
ClosedPublic

Authored by nikic on Oct 27 2021, 6:07 AM.

Details

Summary

GEP decomposition currently checks whether the multiplication of the linear expression offset and GEP scale overflows. However, if everything else works correctly, this overflow check is both unnecessary and dangerously misleading. While it will avoid an overflow in Scale * Offset in particular, other parts of the calculation (including those on dynamic values) may still overflow. The code working on the decomposed GEPs is responsible for ensuring that it remains correct in the presence of overflow. D112611 fixes the last issue of that kind that I'm aware of (in fact, the overflow check was originally introduced to work around precisely that issue).

Diff Detail

Event Timeline

nikic created this revision.Oct 27 2021, 6:07 AM
nikic requested review of this revision.Oct 27 2021, 6:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2021, 6:07 AM
reames accepted this revision.Oct 27 2021, 9:45 AM
This revision is now accepted and ready to land.Oct 27 2021, 9:45 AM
This revision was automatically updated to reflect the committed changes.