[PATCH] D45653: [X86] Enable sibling-call optimization for functions returning structs
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 28 12:12:50 PDT 2018
efriedma added a comment.
In https://reviews.llvm.org/D45653#1215433, @aleksandr.urakov wrote:
> Yes, I meant 32-bit of course.
>
> I'm not sure about this fix, now it doesn't seem so simple to me... What do you think about the next check?
>
> if (IsCalleeWin64 != IsCallerWin64)
> return false;
>
>
> Do you see any pitfalls here?
I would rather not mess with this... mixing win64 and non-win64 calling conventions is going to be extremely rare in practice, and I don't really want to spend time combing through the ABI documents trying to figure out if anything can go wrong.
> As for different sret arguments, I think that it doesn't matter, because they will be processed in the same way for the same calling convention, and it shouldn't break the stack. So we can replace a `call` with a `jump` in this case, right?
The problem would just be that EAX/RAX is set to the wrong value.
https://reviews.llvm.org/D45653
More information about the llvm-commits
mailing list