[PATCH] D32378: Insert invariant.group.barrier for pointers comparisons

Piotr Padlewski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 3 08:41:53 PDT 2017


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





More information about the cfe-commits mailing list