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

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 12:37:38 PST 2022


reames added a comment.

In D117180#3241544 <https://reviews.llvm.org/D117180#3241544>, @xbolva00 wrote:

> In D117180#3241489 <https://reviews.llvm.org/D117180#3241489>, @reames wrote:
>
>> Er, you're correct, but WTF?  We consider an operator new "malloc like"?  That's simply wrong on so many levels.
>>
>> Well, then the original code is buggy.
>
> Non throwing version of new (which may return null) is malloc like.

Please see the C++ specification wording in expr.new paragraph 13.

Calls to the replaceable global allocator are not removable unless coming from a new expression.  I don't believe we have enough information in IR today to tell if they're coming from new expressions or not.


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