[PATCH] D110742: [OpenCL] Add pure and const attributes to vload builtins

Sven van Haastregt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 7 08:52:14 PDT 2021


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



More information about the cfe-commits mailing list