tommat01 wrote:

> > Is it possible / would it make sense to directly annotate these noalias in 
> > the frontend (i.e. when clang emits the outlined function)?
> 
> I hadn't considered that exactly (I tried other frontend fixes) but I think 
> it would work for the outlined function case. The main reason for not doing 
> it in the frontend was to not repeat the same analysis for flang etc. Also 
> (rightly or wrongly) I just had more confidence that Attributor would do the 
> alias analysis correctly; there might be some edge cases in the frontend that 
> could be missed.

Alias analysis is still necessary because the address of the captured values 
might escape before the parallel region:
```
escaped = &value; // address of the slot escapes
#pragma omp parallel
{
  opaque(); // might access the slot via escaped pointer
  use(value);
}
```
In that case annotating the pointer to `value` with `noalias` would be wrong.

https://github.com/llvm/llvm-project/pull/218453
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to