[PATCH] D117180: [BasicAliasAnalysis] Switch from isMallocOrCallocLikeFn to onlyAccessesInaccessibleMemory

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 16 12:35:35 PST 2022


nikic added a comment.

In D117180#3247159 <https://reviews.llvm.org/D117180#3247159>, @Bryce-MW wrote:

> My current thought on how this could be done is to add some sort of optimization flag to clang, say -fstrict-op-new. If off (-fno-strict-op-new), it would mark op new as inaccessiblememonly and possibly removable if we ever add a way to mark that. When they would enable that flag would be up to them. I would say disabled unless -Ofast but maybe because of the regressions we've seen, it should be disabled at -O3 or something. I can't see any easier way to solve this issue unless we basically leave this optimization to LTO where we would know if op new was globally replaced or not.

We do already have something like this in the form of `-fassume-sane-operator-new` (enabled by default I believe). This is what currently gates the `noalias` addition. I don't know whether gating inaccessiblememonly under that as well would be acceptable, as we don't seem to have any documentation on what "sane" requires in that context.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117180/new/

https://reviews.llvm.org/D117180



More information about the llvm-commits mailing list