What is Leaf function?
A function that calls no other functions. Its return address is never overwritten, so it need not be saved, and it often needs no stack frame at all.
Field: ISA & Assembly
A function that calls no other functions. Its return address is never overwritten, so it need not be saved, and it often needs no stack frame at all.
Field: ISA & Assembly
A leaf function never executes jal, so ra stays intact and it can ret without saving it.
A function that calls no other functions (a leaf function) …Return address Stack frame Addressing mode Application binary interface (ABI) Assembler Branch delay slot Callee-saved register Caller-saved register Calling convention Compressed instruction