Landing: 746bdda47afb

Project / Subsystem

gcc / lra

Date

2024-10-18

Author

Kaz Kojima

Commit

746bdda47afbbe4b7cf5581e1f6d86824fdc10b6

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
lra
patch_id
commit_hash
746bdda47afbbe4b7cf5581e1f6d86824fdc10b6
source_type
github
headline
New target hook prevents unsafe constant load substitutions in LRA
tldr
A new target hook, `cannot_substitute_const_equiv_p`, is introduced to prevent the LRA from making incorrect floating-point constant load substitutions.
author
Kaz Kojima
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • register allocation
  • SH
  • target specific
discussion_id_link
bugzilla_pr
date
2024-10-18T00:00:00.000Z

The Local Register Allocator (LRA) can now be prevented from substituting certain floating-point constant loads if a new target hook, cannot_substitute_const_equiv_p, returns true. This addresses issues like those on the SH architecture where specific instructions are mode-dependent and LRA lacked awareness of these constraints, potentially leading to incorrect code generation.