[RFC] Mark tensor.dim and memref.dim as side effecting

I believe this is sort of a continuation of Semantics modeling: Undefined Behavior and Side Effects.
Besides that a few questions:

  • Having both NoObservableSideEffect and NoSideEffect would be a bit confusing. I was currently under the impression that NoSideEffect already accounts for “no side effects being observable” (since as far as I am concerned, a side effect that I can’t observe does not exist). I suppose this also boils down to the question of whether undefined behaviour is observable.
  • Why is a new IsPotentiallySideEffectFree OpInterface required? One can already make ops conditionally have (no) side effects by manually implementing MemoryEffectsOpInterface instead of using the operand annotations. Its not really a proper modelling but eg. using both a MemWrite and MemRead of unspecified location would make the Op not side effect free anymore and server your purpose I believe.
  • Would the motivation of this RFC, hoisting NoSideEffect operations, be better served by an interface/trait that returns whether an operation may be specutatively executed/hoisted?