[llvm-branch-commits] [llvm] [llvm] Extract and propagate indirect call type id (PR #87575)
Prabhu Rajasekaran via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue May 13 10:05:22 PDT 2025
================
@@ -0,0 +1,19 @@
+;; Tests that call site callee type ids can be extracted and set from
+;; callee_type metadata for indirect tail calls.
+
+;; Verify the exact calleeTypeId value to ensure it is not garbage but the value
+;; computed as the type id from the callee_type metadata.
+; RUN: llc --call-graph-section -mtriple aarch64-linux-gnu < %s -stop-after=finalize-isel -o - | FileCheck %s
+
+define i32 @_Z13call_indirectPFicEc(ptr %func, i8 %x) local_unnamed_addr !type !0 {
+entry:
+ ; CHECK: callSites:
+ ; CHECK-NEXT: - { bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [], calleeTypeIds:
+ ; CHECK-NEXT: [ 3498816979441845844 ] }
+ %call = tail call noundef i32 %func(i8 noundef signext %x), !callee_type !1
+ ret i32 %call
+}
+
----------------
Prabhuk wrote:
!callee_type metadata will not be emitted for direct calls. If an indirect call is promoted to a direct call and ends up with a callee_type metadata, we drop the metadata in inlining and instcombine passes. If we still end up with a direct call with a callee_type metadata somehow it will simply be ignored.
https://github.com/llvm/llvm-project/pull/87575
More information about the llvm-branch-commits
mailing list