[llvm-branch-commits] [llvm] [llvm] Extract and propagate indirect call type id (PR #87575)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Mar 17 02:38:51 PDT 2025
================
@@ -0,0 +1,29 @@
+;; Tests that call site type ids can be extracted and set from type operand
+;; bundles.
+
+;; Verify the exact typeId value to ensure it is not garbage but the value
+;; computed as the type id from the type operand bundle.
+; RUN: llc --call-graph-section -mtriple aarch64-linux-gnu < %s -stop-before=finalize-isel -o - | FileCheck %s
+
+define dso_local void @foo(i8 signext %a) !type !0 {
+entry:
+ ret void
+}
+
+; CHECK: name: main
+define dso_local i32 @main() !type !1 {
+entry:
+ %retval = alloca i32, align 4
+ %fp = alloca ptr, align 8
+ store i32 0, ptr %retval, align 4
+ store ptr @foo, ptr %fp, align 8
+ %fp_val = load ptr, ptr %fp, align 8
+ ; CHECK: callSites:
+ ; CHECK-NEXT: - { bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [], typeId:
+ ; CHECK-NEXT: 7854600665770582568 }
+ call void %fp_val(i8 signext 97) [ "callee_type"(metadata !"_ZTSFvcE.generalized") ]
+ ret i32 0
+}
+
----------------
arsenm wrote:
Test case with indirect tail call?
https://github.com/llvm/llvm-project/pull/87575
More information about the llvm-branch-commits
mailing list