[mlir][CSE] fix use-after-free (#203849) There was a use-after free introduced accidentally by e79e056ee982 [mlir][CSE] Remove the opsToErase container and immediately delete dead ops. (#203702) This change fixes it by moving the copy of the location (the "use") to before the deletion of the op (the "free"). Locating the use-after-free has been assisted by Claude Code. The implementation of the fix has been done without it. Signed-off-by: Stefan Schuermans <schuermans@roofline.ai> GitOrigin-RevId: c33a47e6863b3294e693e540df8134a486eafef7
See https://mlir.llvm.org/ for more information.