This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Fixed memory leak after D141726.
ClosedPublic

Authored by vzakhari on Jan 17 2023, 7:29 PM.

Diff Detail

Event Timeline

vzakhari created this revision.Jan 17 2023, 7:29 PM
vzakhari requested review of this revision.Jan 17 2023, 7:29 PM
vitalybuka added inline comments.Jan 17 2023, 9:10 PM
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
1236

Isn't the correct way is to use .get instead if .release here?

vzakhari added inline comments.Jan 17 2023, 9:18 PM
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
1236

I just want to take control over the underlying MDTuple so that I can "wire" it as a Metadata operand, and later delete it (with the new code). FWIW, I believe the same approach is used in llvm/lib/Bitcode/Reader/MetadataLoader.cpp:BitcodeReaderMetadataList::getMetadataFwdRef.

vitalybuka accepted this revision.Jan 17 2023, 9:20 PM
This revision is now accepted and ready to land.Jan 17 2023, 9:20 PM

Please either land this one ASAP, or if you want another review, revert original, to recover bots.

This revision was automatically updated to reflect the committed changes.

I decided to merge this to unblock the sanitizer buildbot. If there are concerns about this code, I will rework it.

I decided to merge this to unblock the sanitizer buildbot. If there are concerns about this code, I will rework it.

Thanks!