Re: [PATCH 2/3] x86: Add a pass to fold tail call

2025-05-05 Thread Andi Kleen
On Mon, May 05, 2025 at 06:20:40AM -0700, Andi Kleen wrote: > > If the branch edge destination is a basic block with only a direct > > sibcall, change the jcc target to the sibcall target, decrement the > > destination basic block entry label use count and redirect the edge > > to the exit basic bl

Re: [PATCH 2/3] x86: Add a pass to fold tail call

2025-05-05 Thread Andi Kleen
> If the branch edge destination is a basic block with only a direct > sibcall, change the jcc target to the sibcall target, decrement the > destination basic block entry label use count and redirect the edge > to the exit basic block. Call delete_unreachable_blocks to delete > the unreachable bas

[PATCH 2/3] x86: Add a pass to fold tail call

2025-05-04 Thread H.J. Lu
x86 conditional branch (jcc) target can be either a label or a symbol. Add a pass to fold tail call with jcc by turning: jcc .L6 ... .L6: jmp tailcall into: jcc tailcall Immediately before the pass which turning REG_EH_REGION notes back into NOTE_INSN_EH_REGI