This is an archive of the discontinued LLVM Phabricator instance.

[BasicAA] Use dereferenceability to reason about aliasing
ClosedPublic

Authored by jdoerfert on Aug 13 2019, 12:09 PM.

Details

Summary

We already use the fact that an object with known size X does not alias
another objection of size Y > X before. With this commit, we use
dereferenceability information to determine a lower bound for Y and not
only rely on the user provided query size.

The result for @global_and_deref_arg_2() and @local_and_deref_ret_2()
in test/Analysis/BasicAA/dereferenceable.ll improved with this patch.

Diff Detail

Repository
rL LLVM

Event Timeline

jdoerfert created this revision.Aug 13 2019, 12:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2019, 12:09 PM
hfinkel added inline comments.Aug 19 2019, 8:09 PM
llvm/lib/Analysis/BasicAliasAnalysis.cpp
236 ↗(On Diff #214898)

extend -> extent

llvm/test/Analysis/BasicAA/dereferenceable.ll
4 ↗(On Diff #214898)

All of these tests check for the 'NoAlias' case. Can you please also add some checks for some associated MayAlias cases to insure that we're not accidentally getting too much?

Fix typo and add baseline tests

jdoerfert marked 2 inline comments as done.Aug 19 2019, 10:04 PM
hfinkel accepted this revision.Aug 21 2019, 6:18 AM

LGTM

This revision is now accepted and ready to land.Aug 21 2019, 6:18 AM
This revision was automatically updated to reflect the committed changes.