[llvm-commits] [patch] Erlang/HiPE calling convention

Yiannis Tsiouris gtsiour at softlab.ntua.gr
Fri Nov 2 08:51:19 PDT 2012


Hi Duncan,

Firstly, I changed:

>   case CallingConv::HiPE:
>     // TailCallOpt doesn't fit our case because Erlang/OTP X86/AMD64 ABI cleary
>     // specifies that callee*always*  pops the arguments.
>     return true;


to:

>  case CallingConv::HiPE:
>      return TailCallOpt;

in the attached as this works fine for us, too.

On 11/02/2012 03:01 PM, Duncan Sands wrote:
> can you please add some tests checking that indirect calls work properly. 
Yes, of course. Which scenario do you want to test? Is something like that:

>  define cc 11 void @baz() nounwind {
>   %tmp_clos = load i64* @clos
>   %tmp_clos2 = inttoptr i64 %tmp_clos to i64*
>   %indirect_call = bitcast i64* %tmp_clos2 to void (i64)*
>   tail call cc 11 void %indirect_call( i64 42 ) nounwind
>   ret void
>}
>
>@clos = external constant i64


ok for u? Actually, this is very similar to how we generate code for 
indirect
calls (mostly closures) in our backend. I'm not sure that it's optimal,
so if anyone has any suggestion, please say! :)

> Also,
> I noticed the following typo:
> --- a/lib/Target/X86/X86ISelLowering.cpp
> +++ b/lib/Target/X86/X86ISelLowering.cpp
> ...
> @@ -3092,6 +3093,10 @@ bool X86::isCalleePop(CallingConv::ID CallingConv,
>      return TailCallOpt;
>    case CallingConv::GHC:
>      return TailCallOpt;
> +  case CallingConv::HiPE:
> +    // TailCallOpt doesn't fit our case because Erlang/OTP X86/AMD64 
> ABI cleary
>
> cleary -> clearly
Good catch!

Re-attaching current state.

Best,
Yiannis

-- 
Yiannis Tsiouris
Ph.D. student,
Software Engineering Laboratory,
National Technical University of Athens
WWW: http://www.softlab.ntua.gr/~gtsiour

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121102/27b35576/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hipe-cc-v3.patch
Type: text/x-patch
Size: 15192 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121102/27b35576/attachment.bin>


More information about the llvm-commits mailing list