Re: [PATCH 0/2] tcg: Fix branch/label link during plugin expansion

2024-09-18 Thread Pierrick Bouvier
On 9/13/24 03:23, Alex Bennée wrote: Richard Henderson writes: On 9/10/24 14:23, Richard Henderson wrote: With tcg_last_op(), we always get the last op of the stream. With TCGContext.emit_before_op, the most recently emitted op is no longer the last op. Instead, pass the op being emitted back

Re: [PATCH 0/2] tcg: Fix branch/label link during plugin expansion

2024-09-13 Thread Richard Henderson
On 9/13/24 03:23, Alex Bennée wrote: Note that the branch is X < 0 (unsigned), which is always false, and thus the branch is optimized away. I'm obviously missing something reading this. How can TCG know the state of the scoreboard variables and optimise away the branch? 0 < 0 is of course fa

Re: [PATCH 0/2] tcg: Fix branch/label link during plugin expansion

2024-09-13 Thread Alex Bennée
Richard Henderson writes: > On 9/10/24 14:23, Richard Henderson wrote: >> With tcg_last_op(), we always get the last op of the stream. >> With TCGContext.emit_before_op, the most recently emitted op >> is no longer the last op. >> Instead, pass the op being emitted back from the allocator so >> t

Re: [PATCH 0/2] tcg: Fix branch/label link during plugin expansion

2024-09-10 Thread Richard Henderson
On 9/10/24 14:23, Richard Henderson wrote: With tcg_last_op(), we always get the last op of the stream. With TCGContext.emit_before_op, the most recently emitted op is no longer the last op. Instead, pass the op being emitted back from the allocator so that we can link it to the label without ne

[PATCH 0/2] tcg: Fix branch/label link during plugin expansion

2024-09-10 Thread Richard Henderson
With tcg_last_op(), we always get the last op of the stream. With TCGContext.emit_before_op, the most recently emitted op is no longer the last op. Instead, pass the op being emitted back from the allocator so that we can link it to the label without needing to look it up. r~ Richard Henderson