This operation fetches an extent value from a fir.shape. The operation
could just as easily live in the fir namespace, but is only needed for
hlfir lowering so I put it here.
This operation is required to allow one to defer getting the extents of a shape
generated by hlfir.get_shape until after that shape has been resolved
(after bufferization of the hlfir.expr).
This operation will be lowered to FIR as an arith.constant created using
the definition of the fir.shape argument.
Depends On: D146830
While I am here, I started adding side effect in my sandbox so that we can leverage some of MLIR analysis. You probably want to add Pure here (it has no memory side effect and is speculatable (can be executed as soon as its operand is ready)).