https://github.com/fhahn commented:

> > I just got a case:
> > ```
> > class A {
> > public:
> >    class B {
> >    public:
> >          B(A *);
> > 
> >          // some non static data fields
> >    };
> > Does this a valid prove that this optimization is not valid ?
> 
> This example is fine because `this` is passed directly to `B`'s constructor, 
> so alias analysis can still succesfully track when it might alias other 
> pointers and stop certain optimizations, despite the `noalias`.

I might be missing something here and it would be good to see how it would like 
in LLVM IR, but if we have `noalias` on a pointer, then alias analysis can use 
this to determine no-alias even if it can also prove that 2 involved pointers 
are equal through other means (this case would be UB). 

https://github.com/llvm/llvm-project/pull/136792
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to