M68k_RTD is really similar to X86's stdcall, in which callee pops the arguments from the stack. In LLVM IR it can be written as m68k_rtdcc.
This patch also improves how ExpandPseudo Pass handles popping stack at function returns in the absent of the RTD instruction.
Details
Diff Detail
Event Timeline
llvm/lib/Target/M68k/M68kExpandPseudo.cpp | ||
---|---|---|
263 | This comment seems to be for code that doesn't currently exist? |
Update code comments.
llvm/lib/Target/M68k/M68kExpandPseudo.cpp | ||
---|---|---|
263 | you're right, I'll remove it (and maybe add it back when we have RTD). |
llvm/lib/Target/M68k/M68kExpandPseudo.cpp | ||
---|---|---|
263 | I don't see any issue in this comment. Doesn't it illustrate what #265 is doing ? Am I missing something ? |
llvm/lib/Target/M68k/M68kExpandPseudo.cpp | ||
---|---|---|
263 | The original comment said that code in this block is the fallback implementation in the absent of RTD instruction. The comment only makes sense if we already have RTD and emit RTD in one of the code path here, which is not the case (yet). |
llvm/lib/Target/M68k/M68kExpandPseudo.cpp | ||
---|---|---|
263 | OhOh I saw the comment you were refering to (which is not the comment I'm thinking about). You are right. No question here ;) |
llvm/include/llvm/AsmParser/LLToken.h | ||
---|---|---|
176 | This is awesome. Thanks ! |
I didn't see any issue here. Let's wait for the approval from other (more senior) reviewers.
You need a test for calling a variadic function which, by my reading of GCC's manage and comparing it to X86, should be unaffected
llvm/test/CodeGen/M68k/CConv/rtd-call.ll | ||
---|---|---|
1 | I don't know if the M68k backend tests do this as religiously as RISCV, but you should probably be using update_mir_test_checks.py for your MIR output tests. | |
llvm/test/CodeGen/M68k/CConv/rtd-ret.ll | ||
6 | nounwind? |
- Handle vararg calls and returns.
- Use update_mir_test_checks for MIR tests.
llvm/test/CodeGen/M68k/CConv/rtd-call.ll | ||
---|---|---|
1 | Thanks, I didn't know there is a UTC for MIR. |
This is awesome. Thanks !