[PATCH] D127383: Don't treat readnone call in presplit coroutine as not access memory

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 01:33:40 PDT 2022


ChuanqiXu added a comment.

In D127383#3634889 <https://reviews.llvm.org/D127383#3634889>, @nikic wrote:

> Compile-time impact is low / acceptable: http://llvm-compile-time-tracker.com/compare.php?from=40a4078e14c2c6c5e2d0a1776285aa7491e791b3&to=d753f388d52778fff19b5a6d82a5b9c4869a4273&stat=instructions
>
> I'm fine with this change, but I didn't follow the original discussion.

Thanks! The original discussion is really long. But I am sure the direction is agreed by at least @jyknight @nhaehnle and @efriedma



================
Comment at: llvm/lib/Analysis/BasicAliasAnalysis.cpp:778-780
+  if (Call->hasFnAttr(Attribute::ReadNone) &&
+      Call->getFunction()->isPresplitCoroutine())
+    return FMRB_OnlyReadsMemory;
----------------
nikic wrote:
> ChuanqiXu wrote:
> > This early return is necessary otherwise it would fall to the combine operation at line 804, which would return FMRB_DoesNotAccessMemory.
> You mean the getModRefBehavior call on the function below? I think it may be better to guard that call instead.
Yeah, I mean the call at line 781. I feel it looks better/cleaner/clearer to put the check here. The logic is consistent with the above check (We can't do better.)


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

https://reviews.llvm.org/D127383



More information about the llvm-commits mailing list