Landing: 5e33bbf6faef

Project / Subsystem

gcc / tree-optimization

Date

2026-05-18

Author

Xin Wang

Commit

5e33bbf6faefa4f848e47e2a3bfec1a971d19cf2

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
tree-optimization
patch_id
commit_hash
5e33bbf6faefa4f848e47e2a3bfec1a971d19cf2
source_type
github
headline
tree-optimization: Fix profile update in loop splitting (initial_true=false)
tldr
Fixes a bug in loop splitting that caused incorrect profile updates when the loop guard condition is inverted.
author
Xin Wang
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • loop splitting
  • bugfix
  • profiling
discussion_id_link
bugzilla_pr
date
2026-05-18T00:00:00.000Z

A bug in loop splitting’s profile update logic has been fixed. When the loop splitting process inverts the guard condition of a loop (e.g., changing t < i to i > t), the profile update code was using incorrect edge probabilities. This resulted in inaccurate BB counts and iteration estimates for the split loops, especially when the initial_true flag was false. The fix ensures that profile quantities are correctly associated with the semantic edges of the split loops.