[PATCH] D115021: [funcatts] Rewrite callsite operand handling in memory access inference

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 2 19:43:45 PST 2021


reames created this revision.
reames added reviewers: jdoerfert, anna, sstefan1, aeubanks, modimo.
Herald added subscribers: ormris, bollu, hiraditya, mcrosier.
reames requested review of this revision.
Herald added projects: clang, LLVM.
Herald added a subscriber: cfe-commits.

This is a rewrite of the existing code.  It isn't even close to NFC as it fixes several problems with the existing code.  Changes detailed below.

1. Argument attributes on an indirect call site are honored.  We'd previously only been honoring these on unknown direct calls, which is just weird.
2. Consistently treat calling a function pointer as an operation which reads the function pointer.  Previously, we gave it different treatment based on which attributes were on the callsite.  (e.g. a readonly callsite vs a writeonly callsite changed the intepretation of the function pointer access for an indirect call)
3. Honor attributes on vararg function declarations when visiting a vararg argument.  (Previously, we aborted the entire analysis.)

In addition to the previously described functional changes, the resulting code is both shorter, and easier to follow.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115021

Files:
  clang/test/CodeGen/arm-cmse-attr.c
  llvm/lib/Transforms/IPO/FunctionAttrs.cpp
  llvm/test/Transforms/FunctionAttrs/nocapture.ll
  llvm/test/Transforms/FunctionAttrs/out-of-bounds-iterator-bug.ll
  llvm/test/Transforms/FunctionAttrs/writeonly.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115021.391530.patch
Type: text/x-patch
Size: 8513 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211203/bade1dc4/attachment.bin>


More information about the llvm-commits mailing list