[llvm-branch-commits] [llvm] b7d8db9 - [LTO] Handle GlobalIFunc in LTOModule::parseSymbols (#212515)

Tobias Hieta via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jul 30 23:58:13 PDT 2026


Author: Marina Taylor
Date: 2026-07-31T08:58:04+02:00
New Revision: b7d8db9ddee73288463108b46aa29871fa95a482

URL: https://github.com/llvm/llvm-project/commit/b7d8db9ddee73288463108b46aa29871fa95a482
DIFF: https://github.com/llvm/llvm-project/commit/b7d8db9ddee73288463108b46aa29871fa95a482.diff

LOG: [LTO] Handle GlobalIFunc in LTOModule::parseSymbols (#212515)

Avoids the assert immediately below.

Fixes #45694

rdar://182744700
(cherry picked from commit a463071dc427777a2a2bfc155c6680d7ff220994)

Added: 
    llvm/test/LTO/X86/ifunc.ll

Modified: 
    llvm/lib/LTO/LTOModule.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/LTO/LTOModule.cpp b/llvm/lib/LTO/LTOModule.cpp
index e821abb6f65bc..c7c44d09b593c 100644
--- a/llvm/lib/LTO/LTOModule.cpp
+++ b/llvm/lib/LTO/LTOModule.cpp
@@ -611,7 +611,7 @@ void LTOModule::parseSymbols() {
       continue;
     }
 
-    if (getTargetTriple().isOSBinFormatXCOFF() && isa<GlobalIFunc>(GV)) {
+    if (isa<GlobalIFunc>(GV)) {
       addDefinedFunctionSymbol(Sym);
       continue;
     }

diff  --git a/llvm/test/LTO/X86/ifunc.ll b/llvm/test/LTO/X86/ifunc.ll
new file mode 100644
index 0000000000000..b0076e1f410e9
--- /dev/null
+++ b/llvm/test/LTO/X86/ifunc.ll
@@ -0,0 +1,18 @@
+; RUN: llvm-as < %s >%t1
+; RUN: llvm-lto -o %t2 %t1
+
+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"
+
+ at f2 = dso_local alias void (), void ()* @f
+ at f = dso_local ifunc void (), bitcast (i8* ()* @f_ifunc to void ()*)
+
+define internal i8* @f_ifunc() {
+entry:
+  ret i8* bitcast (void ()* @f_impl to i8*)
+}
+
+define internal void @f_impl() {
+entry:
+  ret void
+}


        


More information about the llvm-branch-commits mailing list