GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
aarch64 Performance Win

AArch64: Use parallel costs for if-conversion

AArch64 if-conversion profitability now uses parallel instruction costs for better loop optimization.

This commit enhances the AArch64 backend’s if-conversion profitability check by incorporating parallel instruction costs, moving away from a solely serial cost estimation. This allows the compiler to better identify short, independent computations within loops that can be efficiently converted into conditional selects, aligning with the target’s instruction issue rate. This change results in more conditional selects and fewer branches in optimized code, leading to performance improvements, as demonstrated by increased throughput in the Snappy compression benchmark.

In Details

The AArch64 backend's aarch64_noce_conversion_profitable_p function previously used a serial cost model for evaluating the profitability of if-conversion within loops. This could lead to rejecting beneficial conversions of independent computations that fit within the target's issue width. This patch introduces the use of noce_parallel_seq_cost, a more accurate cost model that considers the parallel execution capabilities of the AArch64 architecture. By exporting and utilizing this parallel cost estimation, the compiler can now more effectively identify opportunities for if-conversion, lea…

For Context
if-conversion
A compiler optimization technique that transforms conditional control flow (like if-else statements) into data flow using conditional instructions (like conditional selects) to potentially improve performance by reducing branch prediction misses.
parallel instruction costs
A cost model that estimates the execution time of a sequence of instructions considering the processor's ability to execute multiple instructions concurrently (pipelining and issue width).
serial instruction costs
A cost model that estimates execution time by summing the individual costs of instructions sequentially, without considering parallel execution.
conditional selects
Instructions that choose between two values based on a condition, allowing computation to proceed without branching.
Filed Under: aarch64optimizationif-conversionperformancegcc