I believe this is sort of a continuation of Semantics modeling: Undefined Behavior and Side Effects.
Besides that a few questions:
- Having both
NoObservableSideEffectandNoSideEffectwould be a bit confusing. I was currently under the impression thatNoSideEffectalready 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
IsPotentiallySideEffectFreeOpInterface required? One can already make ops conditionally have (no) side effects by manually implementingMemoryEffectsOpInterfaceinstead of using the operand annotations. Its not really a proper modelling but eg. using both aMemWriteandMemReadof unspecified location would make the Op not side effect free anymore and server your purpose I believe. - Would the motivation of this RFC, hoisting
NoSideEffectoperations, be better served by an interface/trait that returns whether an operation may be specutatively executed/hoisted?