Closed
Description
For example, running:
; ModuleID = 'a.ll'
source_filename = "a.38475855-cgu.0"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@llvm.compiler.used = appending global [2 x i8*] [
i8* bitcast (void ()* @f to i8*),
i8* bitcast (void ()* @g to i8*)
], section "llvm.metadata"
define void @f() unnamed_addr #0 {
start:
ret void
}
define internal void @g() unnamed_addr #0 {
start:
ret void
}
attributes #0 = { "target-cpu"="x86-64" }
through opt -S -mergefunc
, results in g
being removed, even though it was present on llvm.compiler.used.list
:
; ModuleID = 'a.ll'
source_filename = "a.38475855-cgu.0"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@llvm.compiler.used = appending global [2 x i8*] [i8* bitcast (void ()* @f to i8*), i8* bitcast (void ()* @f to i8*)], section "llvm.metadata"
define void @f() unnamed_addr #0 {
start:
ret void
}
attributes #0 = { "target-cpu"="x86-64" }