[PATCH] D115003: [funcattrs] Infer writeonly argument attribute [part 2]

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 4 01:13:23 PST 2022


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:728
+      } else if (CB.hasFnAttr(Attribute::WriteOnly) ||
+                 CB.dataOperandHasImpliedAttr(UseIndex, Attribute::WriteOnly)) {
+        IsWrite = true;
----------------
This could be written as `CB.doesNotReadMemory() || CB.doesNotReadMemory(UseIndex)` for symmetry with the other cases. Though personally I find the naming of these methods really unfortunate (they should probably be called `onlyWritesMemory()`) so maybe the explicit form is better.


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

https://reviews.llvm.org/D115003



More information about the llvm-commits mailing list