[PATCH] D99022: [IR] Mark assume/annotation as InaccessibleMemOnly

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 21 09:49:51 PDT 2021


jdoerfert added a comment.

I think this is sound, I have one inline comment though. The special handling should not be dropped until we make the side-effect even weaker, see below.

In D99022#2639717 <https://reviews.llvm.org/D99022#2639717>, @nikic wrote:

> This is a weaker variant of D89054 <https://reviews.llvm.org/D89054> -- I don't think we're ready for non-speculatable readnone yet, because that would make the intrinsics trivially dead.

Good point. We are working on a new attribute to indicate only certain globals are accessed, we could use that here to limit the effects further.
Basically, we'd say a variable named `__control_dependence` is accessed by these such that we need to keep them in order and with their control dependence
but they would not influence (via AA) any other memory. The initial idea of D89054 <https://reviews.llvm.org/D89054> was that the infinite loop keeps them alive but that is not true in a
mustprogress function, so some "side-effect" needs to be there, the weakest I can come up with is an otherwise unused location.



================
Comment at: llvm/lib/Analysis/BasicAliasAnalysis.cpp:950
-  // that proper control dependencies are maintained but they never mods any
-  // particular memory location.
   //
----------------
This and the snipped below are still "needed". Inaccessiblemem is not as powerful as this logic.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99022



More information about the llvm-commits mailing list