[PATCH] D140704: [NVPTX] Replace PTX's ManagedStringPool with StringSaver

Luke Drummond via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 27 10:58:21 PST 2022


ldrumm created this revision.
ldrumm added reviewers: tra, arsenm, asavonic.
Herald added subscribers: mattd, gchakrabarti, pengfei, hiraditya.
Herald added a project: All.
ldrumm requested review of this revision.
Herald added subscribers: wdng, jholewinski.
Herald added a project: LLVM.

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: 31219796
    After: 31219884
  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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140704

Files:
  llvm/lib/Target/NVPTX/ManagedStringPool.h
  llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
  llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
  llvm/lib/Target/NVPTX/NVPTXRegisterInfo.cpp
  llvm/lib/Target/NVPTX/NVPTXRegisterInfo.h
  llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
  llvm/lib/Target/NVPTX/NVPTXTargetMachine.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140704.485401.patch
Type: text/x-patch
Size: 7474 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221227/69add935/attachment.bin>


More information about the llvm-commits mailing list