[Openmp-commits] [openmp] [Flang][OpenMP][MLIR] Remove deletion of unused declare target global after use replacement (PR #67762)

via Openmp-commits openmp-commits at lists.llvm.org
Thu Sep 28 20:48:12 PDT 2023


agozillon wrote:

The previous method I had worked for this test (a variation of it at least), but only because it wasn't actually deleting the value and was itself a memory leak, I noticed this during a recent rebase on the fix I applied. So my apologies for the bad addition.

Another alternative to letting DCE handle the global would be to have the OMPIRBuilder hold these future dead values 
in a container and then delete them on finalization of the OMPIRBuilder if they no longer have uses (which is at the end of the MLIR module lowering). Not too sure if this approach is preferable to letting DCE handle it however, or if the OMPIRBuilder is 
a reasonable place for this sort of change (I imagine ModuleTranslation isn't, which is why I've mentioned the OMPIRBuilder instead).


https://github.com/llvm/llvm-project/pull/67762


More information about the Openmp-commits mailing list