[all-commits] [llvm/llvm-project] 377e13: [ThinLTO] Only import for non-prevailing interposa...

Shoaib Meenai via All-commits all-commits at lists.llvm.org
Sat Mar 25 21:38:06 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 377e1311d50c7e5b5aab3db081938e0d0ceebdfc
  Author: Shoaib Meenai <smeenai at fb.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M llvm/include/llvm/Transforms/IPO/FunctionImport.h
    M llvm/lib/LTO/LTO.cpp
    M llvm/lib/LTO/ThinLTOCodeGenerator.cpp
    M llvm/lib/Transforms/IPO/FunctionImport.cpp
    A llvm/test/ThinLTO/X86/nonprevailing_weak_globals_import.ll
    A llvm/test/ThinLTO/X86/prevailing_weak_globals_import.ll
    R llvm/test/ThinLTO/X86/weak_globals_import.ll

  Log Message:
  [ThinLTO] Only import for non-prevailing interposable global variables

This logic was added in https://reviews.llvm.org/D95943 specifically to
handle an issue for non-prevailing global variables. It turns out that
it adds a new issue for prevailing glboal variables, since those could
be replaced by an available_externally definition and hence incorrectly
omitted from the output object file. Limit the import to non-prevailing
global variables to fix this, as suggested by @tejohnson.

The bulk of the diff is mechanical changes to thread isPrevailing
through to where it's needed and ensure it's available before the
relevant calls; the actual logic change itself is straightforward.

Fixes https://github.com/llvm/llvm-project/issues/61677

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D146876

More information about the All-commits mailing list