Anastasia added a comment.

In D75285#1903611 <https://reviews.llvm.org/D75285#1903611>, @yaxunl wrote:

> In D75285#1903444 <https://reviews.llvm.org/D75285#1903444>, @rjmccall wrote:
>
> > That is not true for two reasons: first, `restrict` guarantees that the 
> > variable is not accessed through any non-derived l-value within its scope, 
> > and that would certainly include from other threads; and second, it is 
> > undefined behavior for two threads to access the same object without 
> > synchronizing anyway (unless they're both just reading from it).
>
>
> How about the cases where users cannot use restrict but they still want to 
> mark a pointer as invariant? Or even though restrict is used but it is too 
> complicated for alias analysis to deduce invariance?


If we can reuse existing attributes it is better than adding new ones so my 
preference would be to make `restrict` work unless it's absolutely impossible 
for the use case you consider.


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

https://reviews.llvm.org/D75285



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

Reply via email to