[llvm-branch-commits] [llvm-tag] r98037 - in /llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7: ./ lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/tailcall2.ll utils/buildit/GNUmakefile

Bill Wendling isanbard at gmail.com
Mon Mar 8 18:24:12 PST 2010


Author: void
Date: Mon Mar  8 20:24:12 2010
New Revision: 98037

URL: http://llvm.org/viewvc/llvm-project?rev=98037&view=rev
Log:
Copy llvmCore-2324.7 to llvmCore-2324.10 incorporating changes in llvmCore-2324.9.

Added:
    llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/   (props changed)
      - copied from r98029, llvm/tags/Apple/llvmCore-2324.7/
Modified:
    llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/lib/Target/X86/X86ISelLowering.cpp
    llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/test/CodeGen/X86/tailcall2.ll
    llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/utils/buildit/GNUmakefile

Propchange: llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Mar  8 20:24:12 2010
@@ -0,0 +1,22 @@
+Debug
+Release
+Release-Asserts
+mklib
+Makefile.config
+config.log
+config.status
+cvs.out
+autom4te.cache
+configure.out
+LLVM-*
+_distcheckdir
+llvm.spec
+svn-commit.*
+*.patch
+*.patch.raw
+cscope.*
+Debug+Coverage-Asserts
+Release+Coverage-Asserts
+Debug+Coverage
+Release+Coverage
+Debug+Checks

Propchange: llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/
------------------------------------------------------------------------------
    svn:mergeinfo = /llvm/trunk:96621

Modified: llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/lib/Target/X86/X86ISelLowering.cpp?rev=98037&r1=98029&r2=98037&view=diff
==============================================================================
--- llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/lib/Target/X86/X86ISelLowering.cpp Mon Mar  8 20:24:12 2010
@@ -2246,7 +2246,8 @@
 bool MatchingStackOffset(SDValue Arg, unsigned Offset, ISD::ArgFlagsTy Flags,
                          MachineFrameInfo *MFI, const MachineRegisterInfo *MRI,
                          const X86InstrInfo *TII) {
-  int FI;
+  unsigned Bytes = Arg.getValueType().getSizeInBits() / 8;
+  int FI = INT_MAX;
   if (Arg.getOpcode() == ISD::CopyFromReg) {
     unsigned VR = cast<RegisterSDNode>(Arg.getOperand(1))->getReg();
     if (!VR || TargetRegisterInfo::isPhysicalRegister(VR))
@@ -2262,25 +2263,30 @@
       if ((Opcode == X86::LEA32r || Opcode == X86::LEA64r) &&
           Def->getOperand(1).isFI()) {
         FI = Def->getOperand(1).getIndex();
-        if (MFI->getObjectSize(FI) != Flags.getByValSize())
-          return false;
+        Bytes = Flags.getByValSize();
       } else
         return false;
     }
-  } else {
-    LoadSDNode *Ld = dyn_cast<LoadSDNode>(Arg);
-    if (!Ld)
+  } else if (LoadSDNode *Ld = dyn_cast<LoadSDNode>(Arg)) {
+    if (Flags.isByVal())
+      // ByVal argument is passed in as a pointer but it's now being
+      // derefernced. e.g.
+      // define @foo(%struct.X* %A) {
+      //   tail call @bar(%struct.X* byval %A)
+      // }
       return false;
     SDValue Ptr = Ld->getBasePtr();
     FrameIndexSDNode *FINode = dyn_cast<FrameIndexSDNode>(Ptr);
     if (!FINode)
       return false;
     FI = FINode->getIndex();
-  }
+  } else
+    return false;
 
+  assert(FI != INT_MAX);
   if (!MFI->isFixedObjectIndex(FI))
     return false;
-  return Offset == MFI->getObjectOffset(FI);
+  return Offset == MFI->getObjectOffset(FI) && Bytes == MFI->getObjectSize(FI);
 }
 
 /// IsEligibleForTailCallOptimization - Check whether the call is eligible

Modified: llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/test/CodeGen/X86/tailcall2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/test/CodeGen/X86/tailcall2.ll?rev=98037&r1=98029&r2=98037&view=diff
==============================================================================
--- llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/test/CodeGen/X86/tailcall2.ll (original)
+++ llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/test/CodeGen/X86/tailcall2.ll Mon Mar  8 20:24:12 2010
@@ -195,3 +195,24 @@
 }
 
 declare i32 @foo6(i32, i32, %struct.t* byval align 4)
+
+; rdar://r7717598
+%struct.ns = type { i32, i32 }
+%struct.cp = type { float, float }
+
+define %struct.ns* @t13(%struct.cp* %yy) nounwind ssp {
+; 32: t13:
+; 32-NOT: jmp
+; 32: call
+; 32: ret
+
+; 64: t13:
+; 64-NOT: jmp
+; 64: call
+; 64: ret
+entry:
+  %0 = tail call fastcc %struct.ns* @foo7(%struct.cp* byval align 4 %yy, i8 signext 0) nounwind
+  ret %struct.ns* %0
+}
+
+declare fastcc %struct.ns* @foo7(%struct.cp* byval align 4, i8 signext) nounwind ssp

Modified: llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/utils/buildit/GNUmakefile
URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/utils/buildit/GNUmakefile?rev=98037&r1=98029&r2=98037&view=diff
==============================================================================
--- llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/utils/buildit/GNUmakefile (original)
+++ llvm/tags/Apple/llvmCore-2324.10/llvmCore-2324.7/utils/buildit/GNUmakefile Mon Mar  8 20:24:12 2010
@@ -36,7 +36,7 @@
 
 # Unless assertions are forced on in the GMAKE command line, enable them.
 ifndef ENABLE_ASSERTIONS
-ENABLE_ASSERTIONS := yes
+ENABLE_ASSERTIONS := no
 endif
 
 # Default is optimized build.





More information about the llvm-branch-commits mailing list