This fixes the majority of cases where we hit the "hlfir.associate of
hlfir.expr with more than one use" TODO. In particular, this allows cam4
to be built.
hlfir.shape_of is just a way to delay reading shape information until
after intrinsics have been lowered to FIR runtime calls. It gets the
shape information from reading existing SSA values (e.g. fetching the
shape used when hlfir.declare'ing the variable). It does not actually
read from the bufferized value itself. Therefore hlfir.shape_of doesn't
affect decisions about when to deallocate the buffer.
Thanks for the update!
I think we should not return true here and at line 341, because we have not processed all the uses yet. A continue should do.