[PATCH] D116800: [MemoryBuiltins] Remove isNoAliasFn() in favor of isNoAliasCall()

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 7 01:18:26 PST 2022


nikic created this revision.
nikic added reviewers: reames, jdoerfert, fhahn.
Herald added subscribers: ormris, jeroen.dobbelaere, okura, kuter, bmahjour, hiraditya.
nikic requested review of this revision.
Herald added a reviewer: sstefan1.
Herald added a reviewer: baziotis.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We currently have two similar implementations of this concept: isNoAliasCall() only checks for the noalias return attribute. isNoAliasFn() also checks for allocation functions.

We should switch to only checking the attribute. SLC is responsible for inferring the noalias return attribute for non-new allocation functions (with a missing case fixed in https://github.com/llvm/llvm-project/commit/348bc76e3548c52dbcd442590ca0a7f5b09b7534). For new, clang is responsible for setting the attribute, if `-fno-assume-sane-operator-new` is not passed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116800

Files:
  llvm/include/llvm/Analysis/MemoryBuiltins.h
  llvm/lib/Analysis/MemoryBuiltins.cpp
  llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/lib/Transforms/IPO/AttributorAttributes.cpp
  llvm/test/Transforms/GVN/malloc-load-removal.ll
  llvm/unittests/Analysis/MemoryBuiltinsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116800.398078.patch
Type: text/x-patch
Size: 6354 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220107/c826868f/attachment.bin>


More information about the llvm-commits mailing list