在 2026/3/17 18:47, Radosav Krunic 写道:
> 
> [PATCH v2 13/18] Make rtl if-conversion more common:
> https://sourceware.org/pipermail/gcc-patches/2025-March/677824.html
> 
Since commit "ifcvt: Clarify if_info.original_cost"
(9ff5cadac4579fe714dc8de3a39eaef8534c64f7) introduced a new cost model
in ifcvt, the original patch is no longer applicable.

Following the implementation pattern adopted by other architectures like
RISC-V, we should refactor mips_noce_conversion_profitable_p in this way:

1. Create a local copy of struct noce_if_info rather than modifying
the original input structure directly;
2. Compensate target-specific costs by incrementing original_cost
(mips_if_info.original_cost) and max_seq_cost appropriately whenever
conditional move sequences are detected;
3. Invoke default_noce_conversion_profitable_p finally to keep consistent
with the upstream standard cost logic.

In addition, we can incorporate the existing ifcvt-related test cases
from commits ef6c3095aabe75af727a269d91d9ffa37f982ace and
9d5dbf706ad3114fa2c77b15a7bc8ce22e61b17d to ensure full test coverage
for this change.

Best regards,
Jie

Reply via email to