[all-commits] [llvm/llvm-project] cb46e8: [JITLink][RISCV] Avoid quadratic removal of alignm...
Thrrreeee via All-commits
all-commits at lists.llvm.org
Thu Sep 10 04:57:08 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: cb46e8530f3c45be6f968fcdef47f37e5220fe95
https://github.com/llvm/llvm-project/commit/cb46e8530f3c45be6f968fcdef47f37e5220fe95
Author: Thrrreeee <shijinrui at bytedance.com>
Date: 2026-09-10 (Thu, 10 Sep 2026)
Changed paths:
M llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp
A llvm/test/ExecutionEngine/JITLink/RISCV/ELF_relax_many_align.s
Log Message:
-----------
[JITLink][RISCV] Avoid quadratic removal of alignment edges (#222317)
We encountered this issue while using BOLT to instrument clang on
RISC-V. JITLink spent significant time removing alignment edges during
relaxation finalization in large code blocks with many alignment
relocations.
During RISC-V relaxation finalization, finalizeBlockRelax removes
AlignRelaxable edges individually from a block's edge vector. Each erase
shifts the remaining suffix, making this cleanup quadratic when the
number of alignment edges grows with the total edge count.
Compact surviving edges once and remove the trailing entries from the
back, preserving edge order and making cleanup linear. Count the
trailing entries before erasing to avoid comparing an invalidated
iterator.
These results support the performance benefit, but they come from
**GPT-generated** synthetic benchmarks and do not represent speedups on
real BOLT workloads.
count | origin | new
-- | -- | --
16,384 | 92.6 ms | 6.2 ms
32,768 | 430.0 ms | 9.5 ms
65,536 | 1,732.3 ms | 16.2 ms
Assisted by GPT-6.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list