[PATCH] D84860: [LangRef] Add uniqueptr attribute.

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 09:30:47 PDT 2020


hfinkel added a comment.

> We cannot remove the second load, because nothing guarantees that %x did not escape before calling the function. The new attribute provides exactly this guarantee, allowing us to remove the second load.

Why does noalias not provide the relevant guarantee? Even if the pointer had escaped, your call to `@sideeffect` would not be allowed to access the value through that escaped pointer (unless it were passed as an argument to `@sideeffect`) because that would violate the rule that all values accessed through a noalias pointer are accessed only through pointers based on the noalias pointer within the scope of the noalias pointer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84860



More information about the llvm-commits mailing list