GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
xtensa

Xtensa: Improve register class checks in TARGET_SECONDARY_RELOAD

Xtensa's TARGET_SECONDARY_RELOAD hook now uses reg_class_subset_p for more accurate register class evaluation.

The Xtensa target’s TARGET_SECONDARY_RELOAD hook previously had inaccurate register class checks. This patch replaces the direct comparison of register classes with GR_REGS or RL_REGS with a call to reg_class_subset_p(). This ensures the hook correctly evaluates subclasses of GR_REGS, improving accuracy for the Xtensa architecture.

In Details

The Xtensa backend's xtensa_secondary_reload hook, which is invoked during instruction scheduling, previously performed a limited check on register classes. This change enhances the hook by utilizing reg_class_subset_p to accurately determine if a given register class is a subset of another, addressing potential inaccuracies when dealing with multiple GR_REGS subclasses.

Filed Under: xtensaregister allocation