{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/llilc/issues/956","labels_url":"https://api.github.com/repos/dotnet/llilc/issues/956/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/llilc/issues/956/comments","events_url":"https://api.github.com/repos/dotnet/llilc/issues/956/events","html_url":"https://github.com/dotnet/llilc/pull/956","id":118684199,"number":956,"title":"Implement support for tail calls","user":{"login":"AndyAyersMS","id":10121823,"avatar_url":"https://avatars.githubusercontent.com/u/10121823?v=3","gravatar_id":"","url":"https://api.github.com/users/AndyAyersMS","html_url":"https://github.com/AndyAyersMS","followers_url":"https://api.github.com/users/AndyAyersMS/followers","following_url":"https://api.github.com/users/AndyAyersMS/following{/other_user}","gists_url":"https://api.github.com/users/AndyAyersMS/gists{/gist_id}","starred_url":"https://api.github.com/users/AndyAyersMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndyAyersMS/subscriptions","organizations_url":"https://api.github.com/users/AndyAyersMS/orgs","repos_url":"https://api.github.com/users/AndyAyersMS/repos","events_url":"https://api.github.com/users/AndyAyersMS/events{/privacy}","received_events_url":"https://api.github.com/users/AndyAyersMS/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/llilc/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-24T19:22:45Z","updated_at":"2015-11-25T23:03:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/llilc/pulls/956","html_url":"https://github.com/dotnet/llilc/pull/956","diff_url":"https://github.com/dotnet/llilc/pull/956.diff","patch_url":"https://github.com/dotnet/llilc/pull/956.patch"},"body":"Closes #191.\r\n\r\nAdd the `tail` modifier to calls that satisfy correctness checks for tail calls (either explicit or implicit). This will enable LLVM to perform \"sibling\" call optimizations during lowering.\r\n\r\nDo a very simplistic tracking of address-taken locals and args to screen out implicit tail call candidates. Do likewise with localloc. Both these need to be detected during the reader's first pass, so add suitable asserts.\r\n\r\nAlso start tracking unsafe locals, since they (and localloc) will inspire stack security protection checking (aka /GS) and will inhibit tail calls. We still don't actually do the checks (see #353).\r\n\r\nAdd logic to the ABI classifier so we can detect if we're introducing on-stack references for call lowerings and avoid tail calling in those cases too. This can also be made smarter (eg we might be able to copy-prop and use the values passed by the caller).\r\n\r\nHave the jit options determine if the jit is optimizing and use the option setting in the code rather than checking the flags.\r\n\r\nRemove existing NYI for explicit tail calls.\r\n\r\nVerified by hand that the excluded tail call tests all now pass and seem to get most of the tail call cases the tests intended, so unexcluded them. Most \"normal\" bring up tests will create around 150 tail call sites so I think the new codegen gets pretty well tested.\r\n\r\nAlso verified all this works with EH enabled and GC enabled."},"comment":{"url":"https://api.github.com/repos/dotnet/llilc/issues/comments/159751066","html_url":"https://github.com/dotnet/llilc/pull/956#issuecomment-159751066","issue_url":"https://api.github.com/repos/dotnet/llilc/issues/956","id":159751066,"user":{"login":"AndyAyersMS","id":10121823,"avatar_url":"https://avatars.githubusercontent.com/u/10121823?v=3","gravatar_id":"","url":"https://api.github.com/users/AndyAyersMS","html_url":"https://github.com/AndyAyersMS","followers_url":"https://api.github.com/users/AndyAyersMS/followers","following_url":"https://api.github.com/users/AndyAyersMS/following{/other_user}","gists_url":"https://api.github.com/users/AndyAyersMS/gists{/gist_id}","starred_url":"https://api.github.com/users/AndyAyersMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndyAyersMS/subscriptions","organizations_url":"https://api.github.com/users/AndyAyersMS/orgs","repos_url":"https://api.github.com/users/AndyAyersMS/repos","events_url":"https://api.github.com/users/AndyAyersMS/events{/privacy}","received_events_url":"https://api.github.com/users/AndyAyersMS/received_events","type":"User","site_admin":false},"created_at":"2015-11-25T23:03:03Z","updated_at":"2015-11-25T23:03:03Z","body":"Latest CI failure is unrelated; merging."}}