Перейти к содержимому

LLVM IR: musttail - The Tail Call the Compiler Is Not Allowed to Skip

Donutloop

0:00 / 0:00

LLVM IR: musttail - The Tail Call the Compiler Is Not Allowed to Skip

4 просмотра · 4 часа назад
Donutloop
373 подписчика
4 просмотра · 4 часа назад
A tail call is usually a favour the compiler may decline - musttail is the version where declining is an error. musttail demands that the call go out through the caller's own frame instead of stacking a new one, and it pays for that guarantee with the rules it has to follow - the call has to be the last thing before the return, with nothing in between, which is exactly the pairing this lesson's fifth shot points at, and the optimiser could answer the whole recursion outright once it was written that way. #programming #llvm