summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authortstellar <tstellar@91177308-0d34-0410-b5e6-96231b3b80d8>2012-10-03 13:39:44 +0000
committertstellar <tstellar@91177308-0d34-0410-b5e6-96231b3b80d8>2012-10-03 13:39:44 +0000
commit0dab553f5f1d16045534254b9ce66972a03424f7 (patch)
tree236dd2cd778abfee9a2a87eb0e494f0fac480d6c /lib
parentdfd3efcf997492b908ccbf5a5b203447dc2abfe7 (diff)
SI: Fix crash in unused register search in LowerFlowControl pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/R600/@165115 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/AMDGPU/SILowerFlowControl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Target/AMDGPU/SILowerFlowControl.cpp b/lib/Target/AMDGPU/SILowerFlowControl.cpp
index 7ddb1df2c59..62b059f74af 100644
--- a/lib/Target/AMDGPU/SILowerFlowControl.cpp
+++ b/lib/Target/AMDGPU/SILowerFlowControl.cpp
@@ -93,12 +93,12 @@ FunctionPass *llvm::createSILowerFlowControlPass(TargetMachine &tm) {
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);
}
}