Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tail call (LLVM-266) #72

Open
yamt opened this issue Jun 15, 2023 · 5 comments
Open

tail call (LLVM-266) #72

yamt opened this issue Jun 15, 2023 · 5 comments
Labels
Status: In Progress work is in progress

Comments

@yamt
Copy link

yamt commented Jun 15, 2023

there is a todo comment about tail call optimization:

// TODO: Support tail call optimization.
IsTailCall = false;

do you have any plans or ideas about implementation?
i understand that it isn't straightforward with the windowed abi.

@github-actions github-actions bot changed the title tail call tail call (LLVM-266) Jun 15, 2023
@yamt
Copy link
Author

yamt commented Jun 16, 2023

the current code just ignores the musttail attribute.
it should bail out at least.

void
f(void)
{
        void g(void);
        __attribute__((musttail)) return g();
}

@yamt
Copy link
Author

yamt commented Jun 16, 2023

the current code just ignores the musttail attribute. it should bail out at least.

void
f(void)
{
        void g(void);
        __attribute__((musttail)) return g();
}

#73

@andreisfr
Copy link
Collaborator

Hi @yamt ! Thank you for comment, we have a plans about "tail call" implementation.

@espressif-bot espressif-bot added Status: In Progress work is in progress and removed Status: Opened labels Jun 22, 2023
@yamt
Copy link
Author

yamt commented Jun 25, 2023

Hi @yamt ! Thank you for comment, we have a plans about "tail call" implementation.

are you implying a general implementation is possible? how? just curious.

when caller and callee happen to have the same frame size, maybe you can make it jump into callee+3.
otherwise, i'm not sure how it can be done.

@ProfFan
Copy link

ProfFan commented May 6, 2024

Hello @andreisfr do you know what is the status for tail call?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress work is in progress
Projects
None yet
Development

No branches or pull requests

4 participants