[PATCH] D25022: Register Calling Convention - CodeGen Basic Additions

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 09:32:07 PDT 2016


rnk added inline comments.


> X86CallingConv.td:59
> +
> +def RC_X86_64_RegCall_Lin : RC_X86_64_RegCall {
> +  let GPR_8 = [AL, CL, DL, DIL, SIL, R8B, R9B, R12B, R13B, R14B, R15B];

Maybe say "SysV" instead of "Lin". You also want to use this on the BSDs and all non-Windows platforms, right?

> X86CallingConv.td:67
> +// Match if the current subtarget is either Linux or OSX
> +class CCIfSubtargetLinuxOSX<CCAction A> : CCIf<
> +  "static_cast<const X86Subtarget&>(State.getMachineFunction().getSubtarget())."

This would be CCIfSubtargetSysV, and the logic would probably be "!isTargetWindows()" or something like that.

> X86CallingConv.td:1120
> +def CSR_32_RegCall : CalleeSavedRegs<(add ESI, EDI, EBX, EBP, ESP,
> +                                      (sequence "XMM%u", 4, 7))>;
> +def CSR_Win64_RegCall : CalleeSavedRegs<(add RBX, RBP, RSP,

Do you anticipate that users will use this convention in a context where SSE is disabled? If so, you should look at r282819 and do something similar.

Honestly, we should refactor this code. We should probably compute these lists by filtering out register classes in X86RegisterInfo rather than table generating N different lists for every calling convention.

Repository:
  rL LLVM

https://reviews.llvm.org/D25022





More information about the llvm-commits mailing list