[all-commits] [llvm/llvm-project] 0b0931: [funcattrs] Infer writeonly argument attribute [pa...
Philip Reames via All-commits
all-commits at lists.llvm.org
Tue Jan 4 09:08:10 PST 2022
Author: Philip Reames <listmail at philipreames.com>
Date: 2022-01-04 (Tue, 04 Jan 2022)
[funcattrs] Infer writeonly argument attribute [part 2]
This builds on the code from D114963, and extends it to handle calls both direct and indirect. With the revised code structure (from series of previously landed NFCs), this is pretty straight forward.
One thing to note is that we can not infer writeonly for arguments which might be captured. If the pointer can be read back by the caller, and then read through, we have no way to track that. This is the same restriction we have for readonly, except that we get no mileage out of the "callee can be readonly" exception since a writeonly param on a readonly function is either a) readnone or b) UB. This means we can't actually infer much unless nocapture has already been inferred.
Differential Revision: https://reviews.llvm.org/D115003
More information about the All-commits