From: Reid Kleckner Date: Thu, 23 Oct 2014 17:50:42 +0000 (+0000) Subject: Revert "Don't count inreg params when mangling fastcall functions" X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=e852ac77726fe0a741a5a4e06998d273ff41e650 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@8': int __fastcall f(int a, int b); git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220492 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/Mangler.cpp b/lib/IR/Mangler.cpp index 575141aed85..bfed3e39f4e 100644 --- a/lib/IR/Mangler.cpp +++ b/lib/IR/Mangler.cpp @@ -72,9 +72,6 @@ static void AddFastCallStdCallSuffix(raw_ostream &OS, const Function *F, 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()) diff --git a/test/CodeGen/X86/byval-callee-cleanup.ll b/test/CodeGen/X86/byval-callee-cleanup.ll index d2009a8ed96..8e059d43344 100644 --- a/test/CodeGen/X86/byval-callee-cleanup.ll +++ b/test/CodeGen/X86/byval-callee-cleanup.ll @@ -23,5 +23,5 @@ define x86_thiscallcc void @g(i8* %this, %struct.Six* byval %a) { define x86_fastcallcc void @h(i32 inreg %x, i32 inreg %y, %struct.Six* byval %a) { ret void } -; CHECK-LABEL: @h@8: +; CHECK-LABEL: @h@16: ; CHECK: retl $8 diff --git a/test/CodeGen/X86/musttail-indirect.ll b/test/CodeGen/X86/musttail-indirect.ll index f1286181ee5..9d21b5ea5d5 100644 --- a/test/CodeGen/X86/musttail-indirect.ll +++ b/test/CodeGen/X86/musttail-indirect.ll @@ -109,7 +109,7 @@ entry: ret i32 %3 } -; CHECK-LABEL: @fastcall_thunk@4: +; CHECK-LABEL: @fastcall_thunk@8: ; CHECK-NOT: mov %{{.*}}, {{.*(.*esp.*)}} ; CHECK: jmpl ; CHECK-NOT: ret