[PATCH] D76127: [TableGen] Do not set ReadOnly attribute on intrinsics with side effects

TOCK Chiu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 26 18:12:12 PST 2020

TOCK added a comment.

Hi @danilaml,

> The diffs lack context.

This patch is some kind of follow-up of D64414 <https://reviews.llvm.org/D64414>, which make TableGen stop emitting `Attribute::ReadNone` for `IntrNoMem` if such intrinsic is marked as `IntrHasSideEffects`. This patch does the same for other cases like `IntrReadMem`.

> As far as I can tell there is no way in IR to mark something as "this doesn't touch mem but may have other side-effects" so it'd be safe to, for example, move some load past that instruction but not to DCE/CSE it.

As far I can tell most targets simply mark it with side-effects and rely on the backend to do optimization, since it might be able to model the side-effects and have a clearer view of what is really accessed.

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list