[PATCH] D152490: [llvm-profdata] Use StringRef for CallTargetMap

William Junda Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 8 17:56:48 PDT 2023


huangjd created this revision.
Herald added subscribers: hoy, wlei, ormris, wenlei, pengfei, hiraditya.
Herald added a project: All.
huangjd requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Use StringRef as key to CallTargetMap. Previously CallTargetMap uses a StringMap, which actually stores a copy of the string. All strings put in the map is found to be backed by the profile data so a StringRef can be safely used.

This refactoring is a prerequisite to implement phase 2 of MD5 refactoring, where StringRef can represent an MD5 value directly, instead of casting it to a string first.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152490

Files:
  llvm/include/llvm/ProfileData/SampleProf.h
  llvm/lib/ProfileData/SampleProf.cpp
  llvm/lib/ProfileData/SampleProfWriter.cpp
  llvm/lib/Target/X86/X86InsertPrefetch.cpp
  llvm/lib/Transforms/IPO/SampleProfile.cpp
  llvm/tools/llvm-profdata/llvm-profdata.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152490.529796.patch
Type: text/x-patch
Size: 5164 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230609/1bd6c355/attachment.bin>


More information about the llvm-commits mailing list