[llvm-commits] [llvm] r55756 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/fast-cc-callee-pops.ll

Evan Cheng evan.cheng at apple.com
Wed Sep 3 18:04:15 PDT 2008


Author: evancheng
Date: Wed Sep  3 20:04:15 2008
New Revision: 55756

URL: http://llvm.org/viewvc/llvm-project?rev=55756&view=rev
Log:
Remove code that pad number of bytes to pop for X86_FastCall CC. The code doesn't do the "aligning" for Cygwin, Mingw, and Windows. But aligning it on Darwin and Linux breaks gcc compatibility. That ruled out all the platforms we support!

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
    llvm/trunk/test/CodeGen/X86/fast-cc-callee-pops.ll

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=55756&r1=55755&r2=55756&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Sep  3 20:04:15 2008
@@ -1379,14 +1379,6 @@
     }
   }
   
-  // Make sure the instruction takes 8n+4 bytes to make sure the start of the
-  // arguments and the arguments after the retaddr has been pushed are
-  // aligned.
-  if (!Is64Bit && CC == CallingConv::X86_FastCall &&
-      !Subtarget->isTargetCygMing() && !Subtarget->isTargetWindows() &&
-      (StackSize & 7) == 0)
-    StackSize += 4;
-
   ArgValues.push_back(Root);
 
   // Some CCs need callee pop.
@@ -1494,13 +1486,6 @@
   if (CC == CallingConv::Fast)
     NumBytes = GetAlignedArgumentStackSize(NumBytes, DAG);
 
-  // Make sure the instruction takes 8n+4 bytes to make sure the start of the
-  // arguments and the arguments after the retaddr has been pushed are aligned.
-  if (!Is64Bit && CC == CallingConv::X86_FastCall &&
-      !Subtarget->isTargetCygMing() && !Subtarget->isTargetWindows() &&
-      (NumBytes & 7) == 0)
-    NumBytes += 4;
-
   int FPDiff = 0;
   if (IsTailCall) {
     // Lower arguments at fp - stackoffset + fpdiff.

Modified: llvm/trunk/test/CodeGen/X86/fast-cc-callee-pops.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-cc-callee-pops.ll?rev=55756&r1=55755&r2=55756&view=diff

==============================================================================
--- llvm/trunk/test/CodeGen/X86/fast-cc-callee-pops.ll (original)
+++ llvm/trunk/test/CodeGen/X86/fast-cc-callee-pops.ll Wed Sep  3 20:04:15 2008
@@ -3,6 +3,6 @@
 
 ; Check that a fastcc function pops its stack variables before returning.
 
-define x86_fastcallcc void @func(i64 %X, i64 %Y, float %G, double %Z) {
+define x86_fastcallcc void @func(i64 %X, i64 %Y, float %G, double %Z) nounwind {
         ret void
 }





More information about the llvm-commits mailing list