[PATCH] D116426: [InferAttrs] Add writeonly to all the math functions

Benjamin Kramer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 30 15:07:30 PST 2021


bkramer created this revision.
bkramer added reviewers: reames, hfinkel.
Herald added a subscriber: hiraditya.
bkramer requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

All of these functions would be `readnone`, but can't be on platforms
where they can set `errno`. A `writeonly` function with no pointer
arguments can only write (but never read) global state.

Writeonly theoretically allows these calls to be CSE'd (a writeonly call
with the same arguments will always result in the same global stores) or
hoisted out of loops, but that's not implemented currently.

There are a few functions in this list that could be `readnone` instead
of `writeonly`, if someone is interested.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116426

Files:
  llvm/lib/Transforms/Utils/BuildLibCalls.cpp
  llvm/test/Transforms/InferFunctionAttrs/annotate.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116426.396724.patch
Type: text/x-patch
Size: 28206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211230/51e8b5bb/attachment.bin>


More information about the llvm-commits mailing list