[CIR] Wire unreachable and return to MemoryEffectsOpInterface
These operations should be naturally Pure. However, cir.return and
cir.unreachable can inside cir.scope and cir.if. Making it create side
effect if it jump out of scope.
As a result, we check its parent. If it is a function, we make it
pure. Otherwise, we define read an write.
Notice that it is a ground work rather than enable some optimization
now. Currently, Core MLIR doesn't eliminiate now. However, Enzyme MLIR
did a much more optimization and require this feature. I think it
makes sense to have this in upstream now.
Assisted-by: Claude # Test