[BasicAA] Ignore CanBeFreed in minimal extent reasoning
authorNikita Popov <nikita.ppv@gmail.com>
Sun, 3 Oct 2021 15:44:15 +0000 (17:44 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 4 Oct 2021 20:08:57 +0000 (22:08 +0200)
commit30001af84ec5fa0c4f88da1df9c6682bdff44226
tree4555dafffb9cdaf52cfe5f691681a4a7d814e7a2
parent83289665200b6b9212e0ff14e274b2c431a2e1fa
[BasicAA] Ignore CanBeFreed in minimal extent reasoning

When determining NoAlias based on object size and dereferenceability
information, we can ignore frees for the same reason we can ignore
possible null pointers (if null is not a valid pointer): Actually
accessing the null pointer / freed pointer would be immediate UB,
and AA results are only valid under the assumption of an access.

This addresses a minor regression from D110745.

Differential Revision: https://reviews.llvm.org/D111028
llvm/lib/Analysis/BasicAliasAnalysis.cpp
llvm/test/Analysis/BasicAA/dereferenceable.ll