[all-commits] [llvm/llvm-project] ff3898: LTO: Redesign the CFI !aliases metadata.

Peter Collingbourne via All-commits all-commits at lists.llvm.org
Wed Jul 30 14:04:33 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ff38981a5817f06afad2c7e263e3bf8486f35da9
      https://github.com/llvm/llvm-project/commit/ff38981a5817f06afad2c7e263e3bf8486f35da9
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2025-07-30 (Wed, 30 Jul 2025)

  Changed paths:
    M llvm/include/llvm/LTO/LTO.h
    M llvm/lib/LTO/LTO.cpp
    M llvm/lib/Transforms/IPO/LowerTypeTests.cpp
    M llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
    M llvm/test/Transforms/LowerTypeTests/Inputs/exported-funcs.yaml
    M llvm/test/Transforms/LowerTypeTests/export-alias.ll
    M llvm/test/Transforms/ThinLTOBitcodeWriter/function-alias.ll

  Log Message:
  -----------
  LTO: Redesign the CFI !aliases metadata.

With the current aliases metadata we lose information about which groups
of aliases survive symbol resolution. This causes various problems such
as #150075 where symbol resolution breaks the link between alias groups.

In this redesign of the aliases metadata, we stop representing the
individual aliases in !aliases. Instead, the individual aliases are
represented in !cfi.functions in the same way as functions, and the
alias groups (i.e. groups of symbols with the same address) are stored
in !aliases. At symbol resolution time, we filter out all non-prevailing
members of !aliases; the resulting set is used by LowerTypeTests to
recreate the aliases.

With this change it is now possible for a jump table entry to refer
to an alias in one of the ThinLTO object files (e.g. if a function is
non-prevailing but its alias is prevailing), so instead of deleting them,
rename them with the ".cfi" suffix.

Fixes #150070.

Fixes #150075.

Reviewers: teresajohnson, vitalybuka

Reviewed By: vitalybuka

Pull Request: https://github.com/llvm/llvm-project/pull/150690



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