[PATCH] D18714: Add writeonly IR attribute
Mehdi AMINI via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 1 14:37:24 PDT 2016
joker.eph added a comment.
Skimmed through, looks OK in principle, please see inline comments.
================
Comment at: include/llvm/IR/Function.h:291
@@ -290,1 +290,3 @@
+ /// @brief Determine if the function does not access or only reads memory.
+ bool onlyWritesMemory() const {
----------------
Comment needs an update (reads->write)
================
Comment at: include/llvm/IR/Function.h:293
@@ +292,3 @@
+ bool onlyWritesMemory() const {
+ return doesNotAccessMemory() || hasFnAttribute(Attribute::WriteOnly);
+ }
----------------
The name would be more accurate if it was `doNotReadMemory()`.
(I agree there is an unfortunate precedent with `onlyReadsMemory()`
================
Comment at: include/llvm/IR/Intrinsics.td:77
@@ +76,3 @@
+// WriteOnly - The specified argument pointer is not read from through the
+// pointer by the intrinsic.
+class WriteOnly<int argNo> : IntrinsicProperty {
----------------
Not clear (again unfortunate wording in the original)
http://reviews.llvm.org/D18714
More information about the llvm-commits
mailing list