[llvm-branch-commits] [NFC][LowerTypeTests] Add tests for CFI jump table hotness ordering (PR #221045)

Vitaly Buka via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Sep 3 14:48:42 PDT 2026


================
@@ -0,0 +1,179 @@
+; RUN: rm -rf %t && split-file %s %t
+; RUN: opt -S -passes=lowertypetests -lowertypetests-summary-action=export -lowertypetests-read-summary=%t/summary.ll %t/main.ll | FileCheck %s
+
+; Tests that functions in a jump table are reordered according to call edge hotness
+; recorded in the ThinLTO summary index:
+; 1. (Highest priority) Within each strict type, hotter functions are placed later,
+;    ordered strictly by: Cold (0) < Unknown (1) < None (2) < Hot (3) < Critical (4).
+; 2. (High priority) Across fragments, the fragment with the globally hottest function
+;    (@f_critical) is placed at the very end of the jump table.
+; 3. (Best effort) Each strict type's members remain contiguous (lowered to range checks, no holes).
----------------
vitalybuka wrote:

Added TODO

https://github.com/llvm/llvm-project/pull/221045


More information about the llvm-branch-commits mailing list