[PATCH] D18714: Add writeonly IR attribute

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 1 15:54:09 PDT 2016



Sent from my iPhone

> On Apr 1, 2016, at 3:51 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> 
> nhaehnle added inline comments.
> 
> ================
> Comment at: include/llvm/IR/Function.h:293
> @@ +292,3 @@
> +  bool onlyWritesMemory() const {
> +    return doesNotAccessMemory() || hasFnAttribute(Attribute::WriteOnly);
> +  }
> ----------------
> joker.eph wrote:
>> The name would be more accurate if it was `doNotReadMemory()`.
>> (I agree there is an unfortunate precedent with `onlyReadsMemory()`
> Do you mean doesNotReadMemory(), or is the departure from third person intentional? I'll certainly fix the comment.

My English is terrible :)

> 
> ================
> 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 {
> ----------------
> joker.eph wrote:
>> Not clear (again unfortunate wording in the original)
> What's not clear about it? Do you just mean a rephrasing like: "The intrinsic does not read memory through the specified argument pointer

Yes.

-- 
Mehdi


> ."
> 
> Hmm, or is this about the aliasing? I.e. one could clarify "As long as the intrinsic does not have the IntrWriteMem or IntrWriteArgMem properties, the memory pointed to by the pointer may still be read from via a different but aliasing argument pointer or if the intrinsic is not marked as accessing memory only through argument pointers."
> 
> 
> http://reviews.llvm.org/D18714
> 
> 
> 


More information about the llvm-commits mailing list