[llvm] r220492 - Revert "Don't count inreg params when mangling fastcall functions"

Reid Kleckner reid at kleckner.net
Thu Oct 23 10:50:42 PDT 2014


Author: rnk
Date: Thu Oct 23 12:50:42 2014
New Revision: 220492

URL: http://llvm.org/viewvc/llvm-project?rev=220492&view=rev
Log:
Revert "Don't count inreg params when mangling fastcall functions"

This reverts commit r214981.

I'm not sure what I was thinking when I wrote this. Testing with MSVC
shows that this function is mangled to '@f at 8':
  int __fastcall f(int a, int b);

Modified:
    llvm/trunk/lib/IR/Mangler.cpp
    llvm/trunk/test/CodeGen/X86/byval-callee-cleanup.ll
    llvm/trunk/test/CodeGen/X86/musttail-indirect.ll

Modified: llvm/trunk/lib/IR/Mangler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Mangler.cpp?rev=220492&r1=220491&r2=220492&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Mangler.cpp (original)
+++ llvm/trunk/lib/IR/Mangler.cpp Thu Oct 23 12:50:42 2014
@@ -72,9 +72,6 @@ static void AddFastCallStdCallSuffix(raw
   unsigned ArgWords = 0;
   for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end();
        AI != AE; ++AI) {
-    // Skip arguments in registers to handle typical fastcall lowering.
-    if (F->getAttributes().hasAttribute(AI->getArgNo() + 1, Attribute::InReg))
-      continue;
     Type *Ty = AI->getType();
     // 'Dereference' type in case of byval or inalloca parameter attribute.
     if (AI->hasByValOrInAllocaAttr())

Modified: llvm/trunk/test/CodeGen/X86/byval-callee-cleanup.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval-callee-cleanup.ll?rev=220492&r1=220491&r2=220492&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/byval-callee-cleanup.ll (original)
+++ llvm/trunk/test/CodeGen/X86/byval-callee-cleanup.ll Thu Oct 23 12:50:42 2014
@@ -23,5 +23,5 @@ define x86_thiscallcc void @g(i8* %this,
 define x86_fastcallcc void @h(i32 inreg %x, i32 inreg %y, %struct.Six* byval %a) {
   ret void
 }
-; CHECK-LABEL: @h at 8:
+; CHECK-LABEL: @h at 16:
 ; CHECK: retl $8

Modified: llvm/trunk/test/CodeGen/X86/musttail-indirect.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/musttail-indirect.ll?rev=220492&r1=220491&r2=220492&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/musttail-indirect.ll (original)
+++ llvm/trunk/test/CodeGen/X86/musttail-indirect.ll Thu Oct 23 12:50:42 2014
@@ -109,7 +109,7 @@ entry:
   ret i32 %3
 }
 
-; CHECK-LABEL: @fastcall_thunk at 4:
+; CHECK-LABEL: @fastcall_thunk at 8:
 ; CHECK-NOT: mov %{{.*}}, {{.*(.*esp.*)}}
 ; CHECK: jmpl
 ; CHECK-NOT: ret





More information about the llvm-commits mailing list