This is an archive of the discontinued LLVM Phabricator instance.

[BasicAA] Use ranges for more than one index
ClosedPublic

Authored by nikic on Oct 24 2021, 7:20 AM.

Details

Summary

D109746 made BasicAA use range information to determine the minimum/maximum GEP offset. However, it was limited to the case of a single variable index. This patch extends support to multiple indices by adding all the ranges together.

Diff Detail

Event Timeline

nikic created this revision.Oct 24 2021, 7:20 AM
nikic requested review of this revision.Oct 24 2021, 7:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2021, 7:20 AM
courbet accepted this revision.Oct 25 2021, 4:19 AM

Nice !

llvm/lib/Analysis/BasicAliasAnalysis.cpp
1283

this works because Scale and Offset (and therefore, Range) have the same bit width (MaxPointerSize). Maybe add an assert((Range.getBitWidth() == Scale.getBitWidth()) && "why this is guaranteed") ?

This revision is now accepted and ready to land.Oct 25 2021, 4:19 AM
This revision was landed with ongoing or failed builds.Oct 25 2021, 6:31 AM
This revision was automatically updated to reflect the committed changes.
nikic marked an inline comment as done.