Files
clang-p2996/llvm/lib/Analysis/AliasAnalysis.cpp
Nikita Popov 5f57ad85a1 [BasicAA] Remove incorrect rule about constant pointers (#76815)
BasicAA currently says that any Constant cannot alias an identified
local object. This is not correct if the local object escaped, as it's
possible to create a pointer to the escaped object using an inttoptr
constant expression base.

To compensate for this, make sure that inttoptr constant expressions are
treated as escape sources, just like inttoptr instructions. This ensures
that the optimization can still be applied if the local object is
non-escaping. This is sufficient to still optimize the original
motivating case from c53e2ecf02.

Fixes https://github.com/llvm/llvm-project/issues/76789.
2024-01-17 09:31:00 +01:00

33 KiB