Prazek added a comment.

In https://reviews.llvm.org/D32378#741989, @hubert.reinterpretcast wrote:

> Has it been discussed whether this is something to be addressed in the 
> optimizer as opposed to the front-end?


The example that you showed is excellent. I didn't know that LLVM does the 
transformation with pointers and it clearly shows that we need the different 
approach.
I got following idea how to solve it in the middle end - drop all 
invariant.group metadata when we replace dominated uses based on the 
comparison. This works for simple cases, but it doesn't when the changed pointer
is passed to a not inlined function, or returned. The solution I see that does 
not satisfy me, is to put barriers between passed/returned pointer. I will 
bring it to mailing list


https://reviews.llvm.org/D32378



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

Reply via email to