[all-commits] [llvm/llvm-project] 2a551e: Clean up external users of GlobalValue::getGUID(St...
Owen Rodley via All-commits
all-commits at lists.llvm.org
Mon Mar 3 21:28:00 PST 2025
Branch: refs/heads/users/orodley/guid-1
Home: https://github.com/llvm/llvm-project
Commit: 2a551efc474a20aaaf6a326c9ff7cb288ec23c6d
https://github.com/llvm/llvm-project/commit/2a551efc474a20aaaf6a326c9ff7cb288ec23c6d
Author: Owen Rodley <orodley at google.com>
Date: 2025-03-03 (Mon, 03 Mar 2025)
Changed paths:
M llvm/include/llvm/IR/GlobalValue.h
M llvm/include/llvm/IR/ModuleSummaryIndex.h
M llvm/include/llvm/ProfileData/SampleProf.h
M llvm/lib/Analysis/CtxProfAnalysis.cpp
M llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
M llvm/lib/AsmParser/LLParser.cpp
M llvm/lib/Bitcode/Reader/BitcodeReader.cpp
M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
M llvm/lib/CodeGen/PseudoProbeInserter.cpp
M llvm/lib/IR/AsmWriter.cpp
M llvm/lib/IR/Globals.cpp
M llvm/lib/ProfileData/InstrProf.cpp
M llvm/lib/ProfileData/MemProf.cpp
M llvm/lib/ProfileData/SampleProfReader.cpp
Log Message:
-----------
Clean up external users of GlobalValue::getGUID(StringRef)
See https://discourse.llvm.org/t/rfc-keep-globalvalue-guids-stable/84801
for context.
This is a non-functional change which just changes the interface of
GlobalValue, in preparation for future functional changes. This part
touches a fair few users, so is split out for ease of review. Future
changes to the GlobalValue implementation can then be focused purely on
that class.
This does the following:
* Make global identifier computation nominally private. There are a few
users we can't remove yet, but we rename the method to make it clear
that new users shouldn't be added.
* Rename GlobalValue::getGUID(StringRef) to
getGUIDAssumingExternalLinkage. This is simply making explicit at the
callsite what is currently implicit.
* Where possible, migrate users to directly calling getGUID on a
GlobalValue instance.
* Otherwise, where possible, have them call the newly renamed
getGUIDAssumingExternalLinkage, to make the assumption explicit.
* There are a few cases where neither of the above are possible, as the
caller saves and reconstructs the necessary information to compute the
GUID themselves. We want to migrate these callers eventually, but for
this first step we leave them be and allow them to call our nominally
private global identifier computation method.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list