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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 11:55:26 PST 2021


craig.topper added a comment.

In D76127#2510504 <https://reviews.llvm.org/D76127#2510504>, @jdoerfert wrote:

> TBH, I feel "X is readonly and has side effects" sends the wrong message to begin with. It is a contradiction (in the IR world) as basically shown by the need for this patch. Given that there are no examples in-tree I don't understand why one would mark a side-effect intrinsic as readonly (or similar). Long story short, I would argue this should be a loud error, not silently ignored.

Why shouldn't the intrinsics file be able to express the semantics we want even if we can't represent it in IR today?

The annoying issue is that tablegen also uses the WriteMem to force the mayStore flag on any machine IR instruction that has a pattern that references the intrinsic. Machine IR has a separate side effects flag. So we want IntrReadMem+IntrHasSideEffects to only set mayLoad+hasSideEffects in machine IR.


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

https://reviews.llvm.org/D76127



More information about the llvm-commits mailing list