[llvm] [PGO][ICP] Prevent indirect call promotion to functions with incompatible target features (PR #192142)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Mon May 4 16:49:15 PDT 2026
================
@@ -0,0 +1,50 @@
+; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/norepeated-icp-2.prof -S | FileCheck %s
+
+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 p = dso_local global ptr null, align 8
+
+; Function Attrs: uwtable mustprogress
+define dso_local void @_Z3moov() #0 !dbg !7 {
+entry:
+ ret void
+}
+
+; Function Attrs: uwtable mustprogress
+define dso_local void @_Z3hoov() #1 !dbg !11 {
+entry:
+ store ptr @_Z3moov, ptr @p, align 8
+ ret void
+}
+
+; Function Attrs: uwtable mustprogress
+define dso_local void @_Z3goov() #1 !dbg !24 {
+entry:
+ %t0 = load ptr, ptr @p, align 8
+ ; CHECK: icmp eq ptr %t0, @_Z3hoov
+ ; CHECK-NOT: icmp eq ptr %t0, @_Z3moov
----------------
teresajohnson wrote:
Also add a comment about why one target is promoted and the other not
https://github.com/llvm/llvm-project/pull/192142
More information about the llvm-commits
mailing list