[all-commits] [llvm/llvm-project] ec129c: [YAML][NFC] Use BumpPtrAllocator instead of unique...

Amir Ayupov via All-commits all-commits at lists.llvm.org
Wed Aug 9 16:42:40 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec129c28af58d8200538184cab0ec659c437095d
      https://github.com/llvm/llvm-project/commit/ec129c28af58d8200538184cab0ec659c437095d
  Author: Amir Ayupov <aaupov at fb.com>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M llvm/include/llvm/Support/YAMLTraits.h
    M llvm/lib/Support/YAMLTraits.cpp

  Log Message:
  -----------
  [YAML][NFC] Use BumpPtrAllocator instead of unique_ptrs

Avoid both memory leaks and expensive dynamic allocations by using
SpecificBumpPtrAllocator for HNode types. 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

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D155006




More information about the All-commits mailing list