[flang] use runRegionDCE instead of a custom DCE in cg-rewrite
The custom DCE in cg-rewrite is meant to get rid of fir.shape, fir.shift,
fir.shape_shift and fir.slice ops as well as their unused operands
before codegen (that does not lower those abstract operation to LLVM).
However, it turned out to be flowed in case some fir.shape operands were
unused outside of fir.shape and appeared several times as operands:
they were erased at the first appearance, causing the further attemp
to erase it to segfault (since the op IR storage was deallocated).
Instead of trying to fixing the custom DCE code, use mlir::runRegionDCE.
Differential Revision: https://reviews.llvm.org/D143247