Landing: 0e0ddac529e2

Project / Subsystem

gcc / match.pd

Date

2026-08-31

Author

Dipesh Sharma

Commit

0e0ddac529e215ea605541f8613a0777b6f533a6

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
match.pd
patch_id
—
commit_hash
0e0ddac529e215ea605541f8613a0777b6f533a6
source_type
github
headline
Fold nested CPROJ inside CPROJ or CABS.
tldr
Optimized folding of complex number operations improves code generation.
author
Dipesh Sharma
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • complex numbers
discussion_id_link
github:gcc-mirror/gcc#126690
bugzilla_pr
—
date
2026-08-31T00:00:00.000Z

This commit enhances the match.pd optimization pass by introducing patterns to fold complex projection (CPROJ) operations when they are nested within other CPROJ or complex absolute value (CABS) operations. This resolves an issue in GIMPLE SSA where nested calls were not being optimized, leading to less efficient code generation. A new test case verifies the correct folding.