[PATCH] D155006: [YAML][NFC] Use BumpPtrAllocator instead of unique_ptrs

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 15:09:42 PDT 2023


Amir created this revision.
Amir added reviewers: hintonda, dblaikie.
Herald added a subscriber: hiraditya.
Herald added a project: All.
Amir updated this revision to Diff 548365.
Amir added a comment.
Amir edited the summary of this revision.
Amir published this revision for review.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Use SpecificBumpPtrAllocators


Avoid both memory leaks and expensive dynamic allocations by using
BumpPtrAllocator for HNodes. It's expected they're not deallocated until the
`Input` class is destroyed, so deallocating all at once works well in this case.

Reduces YAML profile pre-processing time in BOLT from

>   11.2067 (  3.2%)   1.6487 (  7.3%)  12.8554 (  3.5%)  12.8635 (  5.6%)  pre-process profile data

to

>   10.6613 (  3.1%)   1.6489 (  6.7%)  12.3102 (  3.3%)  12.3134 (  5.3%)  pre-process profile data


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155006

Files:
  llvm/include/llvm/Support/YAMLTraits.h
  llvm/lib/Support/YAMLTraits.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155006.548365.patch
Type: text/x-patch
Size: 6912 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230808/7be27009/attachment.bin>


More information about the llvm-commits mailing list