[llvm] r194632 - R600: Fix uninitialized variable usage

Tom Stellard thomas.stellard at amd.com
Wed Nov 13 15:58:51 PST 2013


Author: tstellar
Date: Wed Nov 13 17:58:51 2013
New Revision: 194632

URL: http://llvm.org/viewvc/llvm-project?rev=194632&view=rev
Log:
R600: Fix uninitialized variable usage

Modified:
    llvm/trunk/lib/Target/R600/SIInstrInfo.cpp

Modified: llvm/trunk/lib/Target/R600/SIInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstrInfo.cpp?rev=194632&r1=194631&r2=194632&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIInstrInfo.cpp Wed Nov 13 17:58:51 2013
@@ -656,18 +656,18 @@ void SIInstrInfo::reserveIndirectRegiste
   for (int Index = Begin; Index <= End; ++Index)
     Reserved.set(AMDGPU::VReg_32RegClass.getRegister(Index));
 
-  for (int Index = std::max(0, Index - 1); Index <= End; ++Index)
+  for (int Index = std::max(0, Begin - 1); Index <= End; ++Index)
     Reserved.set(AMDGPU::VReg_64RegClass.getRegister(Index));
 
-  for (int Index = std::max(0, Index - 2); Index <= End; ++Index)
+  for (int Index = std::max(0, Begin - 2); Index <= End; ++Index)
     Reserved.set(AMDGPU::VReg_96RegClass.getRegister(Index));
 
-  for (int Index = std::max(0, Index - 3); Index <= End; ++Index)
+  for (int Index = std::max(0, Begin - 3); Index <= End; ++Index)
     Reserved.set(AMDGPU::VReg_128RegClass.getRegister(Index));
 
-  for (int Index = std::max(0, Index - 7); Index <= End; ++Index)
+  for (int Index = std::max(0, Begin - 7); Index <= End; ++Index)
     Reserved.set(AMDGPU::VReg_256RegClass.getRegister(Index));
 
-  for (int Index = std::max(0, Index - 15); Index <= End; ++Index)
+  for (int Index = std::max(0, Begin - 15); Index <= End; ++Index)
     Reserved.set(AMDGPU::VReg_512RegClass.getRegister(Index));
 }





More information about the llvm-commits mailing list