On Wed, Jan 29, 2025 at 10:33:14AM +0100, Christoph Müllner wrote:
> The avoid-store-forwarding pass is disabled by default and therefore
> in the risk of bit-rotting.  This patch addresses this by enabling
> the pass at O2 or higher.
> 
> The assembly patterns in `bitfield-bitint-abi-align16.c` and
> `bitfield-bitint-abi-align8.c` have been updated to account for
> the ASF transformations.
> 
> This was bootstrapped on x86-64 and AArch64 and showed no
> regressions in the test suite (--enable-checking=yes,extra and
> all languages).

I dont think this is a good idea without some target specific cost
model. On x86 it will almost certainly generate extra unnecessary
instructions for cases where the cpu can already do fast forwarding.

Basically you would need to teach it about tables like the ones in
https://chipsandcheese.com/p/a-peek-at-sapphire-rapids
(search for load/store)

I suppose it would be ok to enable for some targets that dont have
the necessary hardware but i dont think that would be any modern
x86 part or likely more generally any modern high performance CPU.

Andi

Reply via email to