Re: [PATCH] i386: Relax cmpxchg instruction under -mrelax-cmpxchg-loop [PR 103069]

2022-02-21 Thread Uros Bizjak via Gcc-patches
On Mon, Feb 21, 2022 at 10:29 AM Hongyu Wang wrote: > > Hi, > > For cmpxchg, it is commonly used in spin loop, and several user code > such as pthread directly takes cmpxchg as loop condition, which cause > huge cache bouncing. > > This patch extends previous implementation to relax all cmpxchg >

[PATCH] i386: Relax cmpxchg instruction under -mrelax-cmpxchg-loop [PR 103069]

2022-02-21 Thread Hongyu Wang via Gcc-patches
Hi, For cmpxchg, it is commonly used in spin loop, and several user code such as pthread directly takes cmpxchg as loop condition, which cause huge cache bouncing. This patch extends previous implementation to relax all cmpxchg instruction under -mrelax-cmpxchg-loop with an extra atomic load, com