This is an archive of the discontinued LLVM Phabricator instance.

[BasicAA] Handle known non-zero variable index
ClosedPublic

Authored by nikic on Dec 12 2020, 6:14 AM.

Details

Summary

BasicAA currently handles cases like Scale*V0 + (-Scale)*V1 where V0 != V1, but does not handle the simpler case of Scale*V with V != 0. Add it based on an isKnownNonZero() call.

I'm not passing a context instruction for now, because the existing approach of always using GEP1 for context could result in symmetry issues.

Compile-time impact is close to zero: https://llvm-compile-time-tracker.com/compare.php?from=5e69e2ebad9db2af44362ebe1755c08af002798f&to=2dffc47368b820c651c34156a503943234ea0252&stat=instructions

Diff Detail

Event Timeline

nikic created this revision.Dec 12 2020, 6:14 AM
nikic requested review of this revision.Dec 12 2020, 6:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2020, 6:14 AM
reames accepted this revision.Dec 12 2020, 1:45 PM

LGTM.

This revision is now accepted and ready to land.Dec 12 2020, 1:45 PM
This revision was landed with ongoing or failed builds.Dec 13 2020, 4:22 AM
This revision was automatically updated to reflect the committed changes.