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

Owen Rodley via All-commits all-commits at lists.llvm.org
Thu Mar 27 19:02:40 PDT 2025


  Branch: refs/heads/users/orodley/guid-1
  Home:   https://github.com/llvm/llvm-project
  Commit: e440846372d6f63ea314a08b68ec7aee8c261b3d
      https://github.com/llvm/llvm-project/commit/e440846372d6f63ea314a08b68ec7aee8c261b3d
  Author: Owen Rodley <orodley at google.com>
  Date:   2025-03-28 (Fri, 28 Mar 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)

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.
* Where users don't actually need the gloalIdentifier and just need the
  name, call getName() instead.
* There are a few cases where none 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