This is an archive of the discontinued LLVM Phabricator instance.

[AA] Correctly maintain the sign of PartiaAlias offset
ClosedPublic

Authored by chill on Dec 17 2021, 2:24 AM.

Details

Summary

Preserve the invariant that offset reported in the case of a
PartialAlias between Loc1 and Loc2, is such that Loc1 + Offset = Loc2, where
Loc1 and Loc2 are the first and the second argument, respectively, in alias queries.

Diff Detail

Unit TestsFailed

Event Timeline

chill created this revision.Dec 17 2021, 2:24 AM
chill requested review of this revision.Dec 17 2021, 2:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 17 2021, 2:24 AM
nikic accepted this revision.Dec 17 2021, 2:59 AM

Nice catch, LGTM!

This revision is now accepted and ready to land.Dec 17 2021, 2:59 AM
dfukalov added inline comments.Dec 17 2021, 6:49 AM
llvm/unittests/Analysis/AliasAnalysisTest.cpp
364–366

Thanks!
Nit: I guess you can just extend the previous test "PartialAliasOffset" with this lines (and changed "-1" to "-4").

dfukalov added inline comments.Dec 17 2021, 6:59 AM
llvm/unittests/Analysis/AliasAnalysisTest.cpp
364–366

Sorry, I was wrong here - you indeed need separate test where Loc1 is not GEP.

This revision was landed with ongoing or failed builds.Dec 17 2021, 7:45 AM
This revision was automatically updated to reflect the committed changes.