[all-commits] [llvm/llvm-project] 6aa9cf: [NVPTX] Replace PTX's ManagedStringPool with Strin...

ldrumm via All-commits all-commits at lists.llvm.org
Wed Jan 4 03:28:54 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6aa9cfb13f2599d69f93941f338134fbcc80a799
      https://github.com/llvm/llvm-project/commit/6aa9cfb13f2599d69f93941f338134fbcc80a799
  Author: Luke Drummond <luke.drummond at codeplay.com>
  Date:   2023-01-04 (Wed, 04 Jan 2023)

  Changed paths:
    R llvm/lib/Target/NVPTX/ManagedStringPool.h
    M llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
    M llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
    M llvm/lib/Target/NVPTX/NVPTXRegisterInfo.cpp
    M llvm/lib/Target/NVPTX/NVPTXRegisterInfo.h
    M llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
    M llvm/lib/Target/NVPTX/NVPTXTargetMachine.h

  Log Message:
  -----------
  [NVPTX] Replace PTX's ManagedStringPool with StringSaver

In use ManagedStringPool caused a lot of heap allocations. At least one
for every register name lookup in NVPTXTargetRegisterInfo and one for
every symbol lookup in the target machine and isel lowering. There
already exists an llvm/Support string interning-class that has better
memory performance. Use LLVM's and delete ManagedStringPool which was
unique to PTX

llc Binary Size (.text only; bss and data were unchanged):
  MinsizeRel:
    Before: 31219884
    After: 31219796
  Release:
    Before: 42961872
    After: 42960656

Total heap allocations by the NVPTX string saving code running
check-llvm-codegen-nvptx

Total bytes allocated:
  Before: 2431825
  After: 2288151

(All numbers on x86-64-linux-gnu / gcc-12 / lld14)

I didn't see obvious time differences when running the tests.

Reviewers: tra, avasonic
Differential Revision: https://reviews.llvm.org/D140704




More information about the All-commits mailing list