This is an archive of the discontinued LLVM Phabricator instance.

[X86][Regcall] Add an option to respect regcall ABI v.4 in win64&win32
ClosedPublic

Authored by yubing on Jul 20 2023, 10:06 AM.

Diff Detail

Event Timeline

yubing created this revision.Jul 20 2023, 10:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 10:06 AM
yubing requested review of this revision.Jul 20 2023, 10:06 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 20 2023, 10:06 AM
yubing updated this revision to Diff 542575.Jul 20 2023, 10:11 AM

small fix

pengfei added inline comments.Jul 23 2023, 7:24 PM
clang/lib/Driver/ToolChains/Clang.cpp
7939–7941

Remove parentheses

7978–7980

ditto.

llvm/lib/Target/X86/X86CallingConv.td
468

This will define RetCC_* as well but it is not used, hence will emit warning. Any way to solve it?

yubing updated this revision to Diff 543433.Jul 24 2023, 2:42 AM

make retcc respect regcall ABI v.4 as well

yubing updated this revision to Diff 543437.Jul 24 2023, 2:47 AM

small fix

yubing marked 2 inline comments as done.Jul 24 2023, 2:47 AM
yubing added a reviewer: fzou1.
pengfei added inline comments.Jul 24 2023, 5:42 AM
llvm/lib/Target/X86/X86CallingConv.td
98–103

According to the spec, Win64 calling convention is identical to Linux64 on V4, i.e., both R10 and R11 are reserved. I think you can reuse RC_X86_64_RegCall_SysV instead.

yubing added inline comments.Jul 24 2023, 6:56 AM
llvm/lib/Target/X86/X86CallingConv.td
98–103
yubing added inline comments.Jul 24 2023, 7:14 AM
llvm/lib/Target/X86/X86CallingConv.td
98–103

so R10 and R13 are reserved instead of R10 and R11

yubing updated this revision to Diff 545924.Jul 31 2023, 11:22 PM

address c++ windows's mangling prefix w=>x

yubing updated this revision to Diff 545927.Jul 31 2023, 11:32 PM

update testcase due to w=>x

pengfei accepted this revision.Jul 31 2023, 11:35 PM

LGTM.

This revision is now accepted and ready to land.Jul 31 2023, 11:35 PM