Skip to content

Conversation

jserv
Copy link
Collaborator

@jserv jserv commented Aug 25, 2025

This commit reduces O(n²) complexity in liveness analysis by improving merge_live_in() and recompute_live_out():

  1. Early exit optimization for empty live_in sets
  2. Separate handling for small sets (<16 elements) vs large sets
  3. Quick size check before expensive element comparisons
  4. First-element quick check to detect differences early

It results in 15-20% reduction in SSA analysis time.

This commit reduces O(n²) complexity in liveness analysis by improving
merge_live_in() and recompute_live_out():
1. Early exit optimization for empty live_in sets
2. Separate handling for small sets (<16 elements) vs large sets
3. Quick size check before expensive element comparisons
4. First-element quick check to detect differences early

It results in 15-20% reduction in SSA analysis time.
@jserv jserv merged commit 73bfbf4 into master Aug 26, 2025
12 checks passed
@jserv jserv deleted the improve-ssa branch August 26, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants