Hi Andi, thanks for your response. The pass prevents store forwarding only in cases where smaller stores are followed by a large load. To the best of our knowledge, on most CPUs, the load will stall in that case. Have you taken that into account?
Thanks, Konstantinos On Wed, Apr 23, 2025 at 6:55 AM Andi Kleen <a...@firstfloor.org> wrote: > > 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