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

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 26 12:52:48 PST 2019


rnk added a comment.

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.



================
Comment at: llvm/test/Transforms/FunctionAttrs/writeonly.ll:1-3
+; RUN: opt < %s -O1 -S | FileCheck %s
+; RUN: opt < %s -O2 -S | FileCheck %s
+; RUN: opt < %s -O3 -S | FileCheck %s
----------------
Please just run functionattrs directly.


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