Skip to content

Commit 1f385ed

Browse files
committed
perf(llvm): limit expensive live range splitting
1 parent 03a9a10 commit 1f385ed

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

crates/revmc-llvm/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,6 +1963,11 @@ fn init_() -> Result<()> {
19631963
// which produce identical codegen at that scale. Small functions still benefit from
19641964
// CGP's address sinking and branch optimizations.
19651965
c"--cgpp-huge-func=1000".as_ptr(),
1966+
// Greedy register allocation's global live range splitting is superlinear on large
1967+
// functions with many long-lived values. Treat smaller live ranges as huge so LLVM uses
1968+
// the cheaper splitting path; this preserves code size on snailtracer while cutting llc
1969+
// time by ~3x.
1970+
c"--huge-size-for-split=64".as_ptr(),
19661971
];
19671972
args.extend(extra.iter().map(|s| s.as_ptr()));
19681973
unsafe {

0 commit comments

Comments
 (0)