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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 01:39:20 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/BasicAliasAnalysis.cpp:778-780
+  if (Call->hasFnAttr(Attribute::ReadNone) &&
+      Call->getFunction()->isPresplitCoroutine())
+    return FMRB_OnlyReadsMemory;
----------------
ChuanqiXu wrote:
> 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.)
With your current implementation, won't you still run into a problem with a writeonly function, which will report as writeonly from function FMRB?


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

https://reviews.llvm.org/D127383



More information about the llvm-commits mailing list