diff options
author | Ian Wood <ianwood2024@u.northwestern.edu> | 2024-12-13 17:14:24 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-13 09:14:24 -0800 |
commit | 003a721c1c9e3a99d6d0c1a6755443b260235537 (patch) | |
tree | 0a71e9c54f3a790776f46ebb6d5347e2b403ae75 /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | |
parent | 3fcc302af34f648fb7a56557b6a504fcbf49a115 (diff) | |
download | llvm-003a721c1c9e3a99d6d0c1a6755443b260235537.zip llvm-003a721c1c9e3a99d6d0c1a6755443b260235537.tar.gz llvm-003a721c1c9e3a99d6d0c1a6755443b260235537.tar.bz2 |
[NFC] Don't recompute type name (#119631)
This change uses a local static variable to cache the computed
`StringRef` containing the type's name.
I found that `RelWithDebInfo` builds of MLIR were spending a relatively
large amount of time in `StringRef::find` and I tracked it down to
`getTypeName` which utilizes `StringRef` methods that are defined in a
separate translation unit. This is especially impactful on perf because
`getTypeName` is supposed to be used for debug logging. See an example
here:
https://github.com/llvm/llvm-project/blob/4b825c7417f72ee88ee3e4316d0c01ed463f1241/mlir/include/mlir/IR/Types.h#L294-L300
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
0 files changed, 0 insertions, 0 deletions