[PATCH] D58694: LLVM: Optimization Pass: Function Attribute: Fix error caused by adding incompactible attribute to WriteOnly attribute of pointer argument

Anh Tuyen Tran via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 3 11:53:56 PDT 2019


anhtuyen marked an inline comment as done.
anhtuyen added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:730
+            (A->materialized_use_empty())) {
+          A->removeAttr(Attribute::WriteOnly);
+        } else {
----------------
jdoerfert wrote:
> In general, I dislike specialization for write-only in the first place. If that is voted in, we should make at least the reasoning more explicit: Initializing `R` with readnon above is hard to follow. It should be placed inside this conditional instead.
Hi @jdoerfert , will you like it better if I move the code to handle **writeonly** (and additionally **readonly**) to inside the function **determinePointerReadAttrs** ?


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