[all-commits] [llvm/llvm-project] d3d856: Clean up external users of GlobalValue::getGUID(St...

Owen Rodley via All-commits all-commits at lists.llvm.org
Sun Apr 27 18:10:04 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d3d856ad84698fa4ec66177d00558b2f5b438d3b
      https://github.com/llvm/llvm-project/commit/d3d856ad84698fa4ec66177d00558b2f5b438d3b
  Author: Owen Rodley <orodley at google.com>
  Date:   2025-04-28 (Mon, 28 Apr 2025)

  Changed paths:
    M bolt/lib/Rewrite/PseudoProbeRewriter.cpp
    M llvm/examples/OrcV2Examples/LLJITWithThinLTOSummaries/LLJITWithThinLTOSummaries.cpp
    M llvm/include/llvm/IR/GlobalValue.h
    M llvm/include/llvm/IR/ModuleSummaryIndex.h
    M llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
    M llvm/include/llvm/ProfileData/SampleProf.h
    M llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.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/CodeGen/AsmPrinter/PseudoProbePrinter.cpp
    M llvm/lib/CodeGen/PseudoProbeInserter.cpp
    M llvm/lib/IR/AsmWriter.cpp
    M llvm/lib/IR/Globals.cpp
    M llvm/lib/LTO/LTO.cpp
    M llvm/lib/LTO/ThinLTOCodeGenerator.cpp
    M llvm/lib/ProfileData/InstrProf.cpp
    M llvm/lib/ProfileData/MemProf.cpp
    M llvm/lib/ProfileData/SampleProfReader.cpp
    M llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp
    M llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
    M llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
    M llvm/lib/Transforms/IPO/FunctionImport.cpp
    M llvm/lib/Transforms/IPO/LowerTypeTests.cpp
    M llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
    M llvm/lib/Transforms/IPO/SampleProfile.cpp
    M llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
    M llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
    M llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
    M llvm/tools/llvm-profgen/ProfiledBinary.cpp

  Log Message:
  -----------
  Clean up external users of GlobalValue::getGUID(StringRef) (#129644)

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:

* 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.



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