[llvm-commits] [llvm] r83163 - /llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp

Jim Grosbach grosbach at apple.com
Wed Sep 30 13:35:36 PDT 2009


Author: grosbach
Date: Wed Sep 30 15:35:36 2009
New Revision: 83163

URL: http://llvm.org/viewvc/llvm-project?rev=83163&view=rev
Log:
Add additional assert() to verify no extraneous use of a scavenged register.

Modified:
    llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp

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

==============================================================================
--- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
+++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Wed Sep 30 15:35:36 2009
@@ -744,8 +744,15 @@
       for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i)
         if (MI->getOperand(i).isReg()) {
           unsigned Reg = MI->getOperand(i).getReg();
-          if (Reg == 0 || !TargetRegisterInfo::isVirtualRegister(Reg))
+          if (Reg == 0)
             continue;
+          if (!TargetRegisterInfo::isVirtualRegister(Reg)) {
+            // If we have an active scavenged register, we shouldn't be
+            // seeing any references to it.
+            assert (Reg != CurrentScratchReg
+                    && "overlapping use of scavenged frame index register!");
+            continue;
+          }
 
           // If we already have a scratch for this virtual register, use it
           if (Reg != CurrentVirtReg) {
@@ -770,7 +777,7 @@
 
           // If this is the last use of the register, stop tracking it.
           if (MI->getOperand(i).isKill())
-            CurrentVirtReg = 0;
+            CurrentScratchReg = CurrentVirtReg = 0;
         }
       RS->forward(MI);
     }





More information about the llvm-commits mailing list