This is an archive of the discontinued LLVM Phabricator instance.

[BasicAA] Improve scalable vector handling
ClosedPublic

Authored by nikic on Sep 26 2021, 1:28 PM.

Details

Summary

Currently, DecomposeGEP bails out on the whole decomposition if it encounters a scalable GEP type anywhere. However, it is fine to to still analyze other GEPs that we look through before hitting the scalable GEP. This does means that the decomposed GEP base is no longer required to be the same as the underlying object. However, I don't believe this property is necessary for correctness anymore.

This allows us to compute slightly more precise aliasing results for GEP chains containing scalable vectors, though my primary interest here is simplifying the code.

Diff Detail

Event Timeline

nikic created this revision.Sep 26 2021, 1:28 PM
nikic requested review of this revision.Sep 26 2021, 1:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 26 2021, 1:28 PM
fhahn added a comment.Oct 7 2021, 5:42 AM

This makes sense to me. Are there non-scalable-vector cases where UnderlyingValue[1-2] -> DecompGEP[1-2].Base shows benefits?

nikic added a comment.Oct 7 2021, 5:59 AM

This makes sense to me. Are there non-scalable-vector cases where UnderlyingValue[1-2] -> DecompGEP[1-2].Base shows benefits?

For non-scalable vectors DecompGEP.Base and UnderlyingValue will be the same (at least for now), so this change should be NFC for the non-scalable case.

fhahn accepted this revision.Oct 14 2021, 10:52 AM

This makes sense to me. Are there non-scalable-vector cases where UnderlyingValue[1-2] -> DecompGEP[1-2].Base shows benefits?

For non-scalable vectors DecompGEP.Base and UnderlyingValue will be the same (at least for now), so this change should be NFC for the non-scalable case.

Sounds good, LGTM!

This revision is now accepted and ready to land.Oct 14 2021, 10:52 AM
This revision was automatically updated to reflect the committed changes.

This makes sense to me. Are there non-scalable-vector cases where UnderlyingValue[1-2] -> DecompGEP[1-2].Base shows benefits?

Btw, for the full restrict patches, this is also helpful.