[llvm-commits] [llvm] r58489 - in /llvm/trunk/lib: CodeGen/PrologEpilogInserter.cpp Target/X86/X86RegisterInfo.cpp

Bill Wendling isanbard at gmail.com
Thu Oct 30 21:00:24 PDT 2008


Author: void
Date: Thu Oct 30 23:00:23 2008
New Revision: 58489

URL: http://llvm.org/viewvc/llvm-project?rev=58489&view=rev
Log:
Don't skip over all "terminator" instructions when determining where to put the
callee-saved restore code. It could skip over conditional jumps
accidentally. Instead, just skip the "return" instructions.


Modified:
    llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
    llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp

Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=58489&r1=58488&r2=58489&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
+++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Thu Oct 30 23:00:23 2008
@@ -273,10 +273,10 @@
       MBB = FI;
       I = MBB->end(); --I;
 
-      // Skip over all terminator instructions, which are part of the return
+      // Skip over all "return" instructions, which are part of the return
       // sequence.
       MachineBasicBlock::iterator I2 = I;
-      while (I2 != MBB->begin() && (--I2)->getDesc().isTerminator())
+      while (I2 != MBB->begin() && (--I2)->getDesc().isReturn())
         I = I2;
 
       bool AtStart = I == MBB->begin();

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

==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Thu Oct 30 23:00:23 2008
@@ -850,8 +850,7 @@
   while (MBBI != MBB.begin()) {
     MachineBasicBlock::iterator PI = prior(MBBI);
     unsigned Opc = PI->getOpcode();
-    if (Opc != X86::POP32r && Opc != X86::POP64r &&
-        !PI->getDesc().isTerminator())
+    if (Opc != X86::POP32r && Opc != X86::POP64r && !PI->getDesc().isReturn())
       break;
     --MBBI;
   }





More information about the llvm-commits mailing list