[llvm-branch-commits] [llvm-branch] r165115 - /llvm/branches/R600/lib/Target/AMDGPU/SILowerFlowControl.cpp

Tom Stellard thomas.stellard at amd.com
Wed Oct 3 06:39:44 PDT 2012


Author: tstellar
Date: Wed Oct  3 08:39:44 2012
New Revision: 165115

URL: http://llvm.org/viewvc/llvm-project?rev=165115&view=rev
Log:
SI: Fix crash in unused register search in LowerFlowControl pass

Modified:
    llvm/branches/R600/lib/Target/AMDGPU/SILowerFlowControl.cpp

Modified: llvm/branches/R600/lib/Target/AMDGPU/SILowerFlowControl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/R600/lib/Target/AMDGPU/SILowerFlowControl.cpp?rev=165115&r1=165114&r2=165115&view=diff
==============================================================================
--- llvm/branches/R600/lib/Target/AMDGPU/SILowerFlowControl.cpp (original)
+++ llvm/branches/R600/lib/Target/AMDGPU/SILowerFlowControl.cpp Wed Oct  3 08:39:44 2012
@@ -93,12 +93,12 @@
 bool SILowerFlowControlPass::runOnMachineFunction(MachineFunction &MF) {
 
   // Find all the unused registers that can be used for the predicate stack.
-  for (TargetRegisterClass::iterator S = AMDGPU::SReg_64RegClass.begin(),
-                                     I = AMDGPU::SReg_64RegClass.end();
-                                     I != S; --I) {
+  for (TargetRegisterClass::iterator I = AMDGPU::SReg_64RegClass.begin(),
+                                     S = AMDGPU::SReg_64RegClass.end();
+                                     I != S; ++I) {
     unsigned Reg = *I;
     if (!MF.getRegInfo().isPhysRegOrOverlapUsed(Reg)) {
-      UnusedRegisters.push_back(Reg);
+      UnusedRegisters.insert(UnusedRegisters.begin(), Reg);
     }
   }
 





More information about the llvm-branch-commits mailing list