[PATCH] D58694: LLVM: Optimization Pass: Function Attribute: No read-attribute should be added if the argument is WriteOnly

Anh Tuyen Tran via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 26 13:05:46 PST 2019


anhtuyen added a comment.

In D58694#1411172 <https://reviews.llvm.org/D58694#1411172>, @rnk wrote:

> This seems like the wrong fix, I would expect functionattrs to improve the deduction by removing the writeonly attribute.
>
> > Despite its name, the readnone attribute has implied semantics about write operations:
>
> readnone makes more sense when you consider it as a strengthening of readonly, which implies no write operations.


Removing an attribute explicitly added by the user (writeonly) and replacing it with the attribute we deduced (readnone) ? That might not be the improvement we want.
A side note, but the snippet was reduced from an actual code, where the writeonly is required.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58694/new/

https://reviews.llvm.org/D58694





More information about the llvm-commits mailing list