[PATCH] D137937: [TableGen] Represent IntrHasSideEffects using inaccessiblemem read+write

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 06:42:54 PST 2022


nikic added a comment.

In D137937#3924807 <https://reviews.llvm.org/D137937#3924807>, @foad wrote:

>> Map IntrHasSideEffects to a read+write of inaccessible memory, **which is the usual way to represent a side effect that cannot be modelled more precisely**. [emphasis mine]
>
> Is it? Does that mean that things-with-side-effects only interact with other things-with-side-effects? Is that really the intention of the hasSideEffects flag on an intrinsic?

It's the closest we can represent. Of course, it the intrinsic has other effects that we explicitly model (such as ordinary memory effects, unwinding effects or divergence effects) then those need to be explicitly stated, but if the effect doesn't fall into one of those categories, then we can currently only model it via inaccessible memory, which at least enforces some of the basic expectations for side-effecting instructions (no DCE, no reordering relative to other effects, no movement across control flow).


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

https://reviews.llvm.org/D137937



More information about the llvm-commits mailing list