[llvm-branch-commits] [llvm-branch] r81690 - in /llvm/branches/release_26/lib/Target/X86: X86InstrInfo.cpp X86JITInfo.cpp X86Subtarget.cpp

Tanya Lattner tonic at nondot.org
Sun Sep 13 11:53:07 PDT 2009


Author: tbrethou
Date: Sun Sep 13 13:53:07 2009
New Revision: 81690

URL: http://llvm.org/viewvc/llvm-project?rev=81690&view=rev
Log:
Merge 80370 from mainline.
Short-term workaround for frame-related weirdness on win64.
Some other minor win64 fixes as well.

Modified:
    llvm/branches/release_26/lib/Target/X86/X86InstrInfo.cpp
    llvm/branches/release_26/lib/Target/X86/X86JITInfo.cpp
    llvm/branches/release_26/lib/Target/X86/X86Subtarget.cpp

Modified: llvm/branches/release_26/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_26/lib/Target/X86/X86InstrInfo.cpp?rev=81690&r1=81689&r2=81690&view=diff

==============================================================================
--- llvm/branches/release_26/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/branches/release_26/lib/Target/X86/X86InstrInfo.cpp Sun Sep 13 13:53:07 2009
@@ -2037,6 +2037,7 @@
   if (MI != MBB.end()) DL = MI->getDebugLoc();
 
   bool is64Bit = TM.getSubtarget<X86Subtarget>().is64Bit();
+  bool isWin64 = TM.getSubtarget<X86Subtarget>().isTargetWin64();
   unsigned SlotSize = is64Bit ? 8 : 4;
 
   MachineFunction &MF = *MBB.getParent();
@@ -2053,7 +2054,7 @@
     if (Reg == FPReg)
       // X86RegisterInfo::emitPrologue will handle spilling of frame register.
       continue;
-    if (RegClass != &X86::VR128RegClass) {
+    if (RegClass != &X86::VR128RegClass && !isWin64) {
       CalleeFrameSize += SlotSize;
       BuildMI(MBB, MI, DL, get(Opc)).addReg(Reg, RegState::Kill);
     } else {
@@ -2077,6 +2078,7 @@
   MachineFunction &MF = *MBB.getParent();
   unsigned FPReg = RI.getFrameRegister(MF);
   bool is64Bit = TM.getSubtarget<X86Subtarget>().is64Bit();
+  bool isWin64 = TM.getSubtarget<X86Subtarget>().isTargetWin64();
   unsigned Opc = is64Bit ? X86::POP64r : X86::POP32r;
   for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
     unsigned Reg = CSI[i].getReg();
@@ -2084,7 +2086,7 @@
       // X86RegisterInfo::emitEpilogue will handle restoring of frame register.
       continue;
     const TargetRegisterClass *RegClass = CSI[i].getRegClass();
-    if (RegClass != &X86::VR128RegClass) {
+    if (RegClass != &X86::VR128RegClass && !isWin64) {
       BuildMI(MBB, MI, DL, get(Opc), Reg);
     } else {
       loadRegFromStackSlot(MBB, MI, Reg, CSI[i].getFrameIdx(), RegClass);

Modified: llvm/branches/release_26/lib/Target/X86/X86JITInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_26/lib/Target/X86/X86JITInfo.cpp?rev=81690&r1=81689&r2=81690&view=diff

==============================================================================
--- llvm/branches/release_26/lib/Target/X86/X86JITInfo.cpp (original)
+++ llvm/branches/release_26/lib/Target/X86/X86JITInfo.cpp Sun Sep 13 13:53:07 2009
@@ -24,7 +24,7 @@
 using namespace llvm;
 
 // Determine the platform we're running on
-#if defined (__x86_64__) || defined (_M_AMD64)
+#if defined (__x86_64__) || defined (_M_AMD64) || defined (_M_X64)
 # define X86_64_JIT
 #elif defined(__i386__) || defined(i386) || defined(_M_IX86)
 # define X86_32_JIT

Modified: llvm/branches/release_26/lib/Target/X86/X86Subtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_26/lib/Target/X86/X86Subtarget.cpp?rev=81690&r1=81689&r2=81690&view=diff

==============================================================================
--- llvm/branches/release_26/lib/Target/X86/X86Subtarget.cpp (original)
+++ llvm/branches/release_26/lib/Target/X86/X86Subtarget.cpp Sun Sep 13 13:53:07 2009
@@ -160,7 +160,7 @@
 /// specified arguments.  If we can't run cpuid on the host, return true.
 bool X86::GetCpuIDAndInfo(unsigned value, unsigned *rEAX, unsigned *rEBX,
                           unsigned *rECX, unsigned *rEDX) {
-#if defined(__x86_64__) || defined(_M_AMD64)
+#if defined(__x86_64__) || defined(_M_AMD64) || defined (_M_X64)
   #if defined(__GNUC__)
     // gcc doesn't know cpuid would clobber ebx/rbx. Preseve it manually.
     asm ("movq\t%%rbx, %%rsi\n\t"





More information about the llvm-branch-commits mailing list