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

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 12:40:01 PST 2022


xbolva00 added a comment.

In D117180#3241552 <https://reviews.llvm.org/D117180#3241552>, @reames wrote:

> 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.

Yeah I know and we have many related PRs. Everything related to C++ “new” is a mess.


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