3 ms·
Sorry, I should have been more precise: I was referring to detecting that a function is tail recursive. (Yours is still a helpful explanation, though -- than
by omginternets 6y ago
Sorry, I should have been more precise: I was referring to detecting that a function is tail recursive.
(Yours is still a helpful explanation, though -- thanks!)
- maximilianburke 6y agoI can't say how LLVM does it but in a compiler I built I detected tail recursion by scanning the IR and if the value of a recursive call (ie: call to self) was immediately returned it was considered a candidate for TCE. If the value was consumed by the parent, it wasn't.