
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
31 lines
1014 B
LLVM
31 lines
1014 B
LLVM
; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s
|
|
; RUN: llvm-modextract -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=CHECK1 %s
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
define hidden void @Func() !type !0 {
|
|
ret void
|
|
}
|
|
|
|
; CHECK1: !cfi.functions = !{![[F1:[0-9]+]], ![[F2:[0-9]+]], ![[F3:[0-9]+]], ![[F4:[0-9]+]]}
|
|
; CHECK1: !aliases = !{![[A:[0-9]+]]}
|
|
|
|
; CHECK1: ![[F1]] = !{!"Func", i8 0, ![[T:[0-9]+]]}
|
|
; CHECK1: ![[T]] = !{i64 0, !"_ZTSFvvE"}
|
|
; CHECK1: ![[F2]] = !{!"Alias", i8 0, ![[T]]}
|
|
; CHECK1: ![[F3]] = !{!"Hidden_Alias", i8 0, ![[T]]}
|
|
; CHECK1: ![[F4]] = !{!"Weak_Alias", i8 0, ![[T]]}
|
|
;
|
|
; CHECK1: ![[A]] = !{!"Func", !"Alias", !"Hidden_Alias", !"Weak_Alias"}
|
|
@Alias = hidden alias void (), ptr @Func
|
|
@Hidden_Alias = hidden alias void (), ptr @Func
|
|
@Weak_Alias = weak alias void (), ptr @Func
|
|
|
|
@Variable = global i32 0
|
|
|
|
; Only generate summary alias information for aliases to functions
|
|
; CHECK1-NOT: Variable_Alias
|
|
@Variable_Alias = alias i32, ptr @Variable
|
|
|
|
!0 = !{i64 0, !"_ZTSFvvE"}
|