[PATCH] D146233: [LICM] Don't promote store to global even in single-thread mode

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 14:44:16 PDT 2023


jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

In D146233#4200610 <https://reviews.llvm.org/D146233#4200610>, @nikic wrote:

> In D146233#4200306 <https://reviews.llvm.org/D146233#4200306>, @jdoerfert wrote:
>
>> Can we make this less drastic by checking the global. If it is internal and doesn't have its address taken there are no aliasing pointers, I think/hope.
>
> I don't think there's any simple way to do this. Note that this does not actually require the address to be taken -- creating a noalias pointer does not constitute a capture.
>
> It's probably worth pointing out that this code was only recently introduced by D130466 <https://reviews.llvm.org/D130466> and only applies under `-mthread-model=single`. This change does not affect/regress normal LICM.

I didn't realize the latter. I was thinking we could look at all uses, >50% of the time we probably only see loads, stores, and mem* intrinsic uses. That said, there is no need only for some non-default use case.


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

https://reviews.llvm.org/D146233



More information about the llvm-commits mailing list