This patch implements call lowering for calls without parameters on AIX as initial support.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| llvm/lib/Target/TargetMachine.cpp | ||
|---|---|---|
| 186 | No TT.isOSBinFormatWasm() anymore? | |
| llvm/lib/Target/TargetMachine.cpp | ||
|---|---|---|
| 186 | Thanks for catching this. I will add it back in. | |
| llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
|---|---|---|
| 6612 | minor nit: missing period. | |
| 6616 | We don't need !isTailCall in the condition here. | |
| 6624 | With this patch AIX is using IsEligibleForTailCallOptimization to determine if a call can be a tail-call. Is this safe because we expect getTargetMachine().Options.GuaranteedTailCallOpt to be false on AIX ? If thats the case then we should assert that here. Or should we have an llvm_unreachable here for unsupported tail-calls for now? | |
| llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
|---|---|---|
| 6595 | Please use report_fatal_error instead of llvm_unreachable for code that you expect is actually reachable. | |
| llvm/lib/Target/PowerPC/PPCCallingConv.td | ||
|---|---|---|
| 309 | Testing seems to confirm that r13 is a non-volatile as is stated in Table 5 of AIX Version 7.2: Assembler Language Reference under the 32-bit environment. int main(void) {
int ret, val = 55;
__asm__(
"mr 13,%1\n\t"
"mr %0,13"
: "=r"(ret)
: "r"(val)
: "r13"
);
return ret;
} | |
| llvm/lib/Target/PowerPC/PPCFrameLowering.cpp | ||
|---|---|---|
| 74 | Minor nit: We should group checks of "similar" properties together. So, AIX and Darwin together. | |
| llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
| 5157–5158 | Minor: No comma for lists of less than three items. Suggestion:
| |
| 5164 | The NOP may change to become some other NOP. | |
| 5167–5169 | Minor nit: Missing space before !isPatchPoint. | |
| llvm/lib/Target/PowerPC/PPCISelLowering.h | ||
| 1120 | Minor nit: Indentation needs adjustment. | |
| llvm/lib/Target/PowerPC/PPCInstrInfo.td | ||
| 1460 | Minor nit: Other blocks align to after the <. | |
| llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
|---|---|---|
| 6599 | This should say "reserved". The Darwin version uses pre-reserved; the prefix seems redundant. | |
| 6604 | s/its varargs/the callee is variadic/; | |
| llvm/test/CodeGen/PowerPC/test_call_aix.ll | ||
| 12 | Question: Where is the code that ensures quadword (16-byte) alignment of the stack? | |
| llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
|---|---|---|
| 6624 | getTargetMachine().Options.GuaranteedTailCallOpt could return true if -tailcallopt is passed in from the command line. | |
| llvm/test/CodeGen/PowerPC/test_call_aix.ll | ||
| 12 | I believe it's done in PPCFrameLowering::determineFrameLayout. | |
One minor comment; otherwise, all of my comments have been addressed.
| llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
|---|---|---|
| 5157 | Add "the" before AIX to clarify binding of "64-bit" as applying only to SVR4. | |
Testing seems to confirm that r13 is a non-volatile as is stated in Table 5 of AIX Version 7.2: Assembler Language Reference under the 32-bit environment.
int main(void) { int ret, val = 55; __asm__( "mr 13,%1\n\t" "mr %0,13" : "=r"(ret) : "r"(val) : "r13" ); return ret; }