svenvh added a comment.

> For the constant address space, the const attribute (or readnone) can be 
> used. As memory in the constant address space is immutable, the statement in 
> the langref that: "if a readnone function reads or writes memory visible to 
> the program, or has other side-effects, the behavior is undefined" does not 
> apply. The reading of immutable memory does not have side-effects, nor can it 
> be affected by side-effects.

I think `readnone` might be too strong, because the pointer argument will still 
be dereferenced (while `readnone` implies that "the function computes its 
result [...] based strictly on its arguments, without dereferencing any pointer 
arguments").


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110742

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to