[PATCH] D130466: [LICM] - Add option to allow data races

Shubham Narlawar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 03:12:43 PDT 2022


gsocshubham added a comment.

In D130466#3761744 <https://reviews.llvm.org/D130466#3761744>, @efriedma wrote:

>> Prohibit this transformation if store points to constant memory using bool PointToConstantMemory.
>
> You can't use pointsToConstantMemory to prove the property you need.  The problem is that it doesn't do what you want if it can't prove anything.  You need a function that says the memory isn't writable unless it can prove the memory is writable (maybe call it something like "pointsToWritableMemory").

Understood. Should I add isNotCapturedBeforeOrInLoop() as an extra check as mentioned by @nikic ?

> Getting the proof requirements wrong is a common trap for newcomers to writing compiler optimizations; please watch out for it in the future.

Noted. Thanks!


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

https://reviews.llvm.org/D130466



More information about the llvm-commits mailing list