Landing: 66ed104db50c

Project / Subsystem

gcc / tree-optimization

Date

2026-08-24

Author

Richard Biener

Commit

66ed104db50c639c79e7ba2826ccd6df41cb37c1

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
tree-optimization
patch_id
—
commit_hash
66ed104db50c639c79e7ba2826ccd6df41cb37c1
source_type
github
headline
Loop unswitching now hoists loop invariants
tldr
Loop unswitching optimization now also hoists loop-invariant statements, improving vectorization opportunities.
author
Richard Biener
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • loops
  • • vectorization
discussion_id_link
—
bugzilla_pr
—
date
2026-08-24T00:00:00.000Z

GCC’s loop unswitching optimization has been enhanced to also perform loop invariant motion. This means that statements whose values do not change within the loop are now moved out of the loop, even if they cannot be if-converted. This behavior aligns with other loop optimizations like interchange and unroll-and-jam, and prevents invariant statements from hindering vectorization.