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 (2): tcg: Return TCGOp from tcg_gen_op[1-6] tcg: Propagate new TCGOp to add_as_label_use tcg/tcg-internal.h | 12 +++---- tcg/tcg-op.c | 86 +++++++++++++++++++++++++--------------------- 2 files changed, 53 insertions(+), 45 deletions(-) -- 2.43.0