summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Lejeune <vljn@ovi.com>2013-03-23 18:17:18 +0100
committerVincent Lejeune <vljn@ovi.com>2013-03-23 18:17:18 +0100
commit53e344e2b18bc4de7337090daa501eb0cb48d516 (patch)
treeef1845b9b12a0722330f89d9cb9bbbf31b1b5f47
parentca29ba4fe4081799de48bf7e78705f92c4b55d80 (diff)
fix infinite loop
-rw-r--r--lib/Target/R600/R600EmitClauseMarkers.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Target/R600/R600EmitClauseMarkers.cpp b/lib/Target/R600/R600EmitClauseMarkers.cpp
index 4ba1be48e2..db14c2fb6c 100644
--- a/lib/Target/R600/R600EmitClauseMarkers.cpp
+++ b/lib/Target/R600/R600EmitClauseMarkers.cpp
@@ -210,7 +210,7 @@ private:
.addImm(0) // KLINE0
.addImm(0) // KLINE1
.addImm(AluInstCount); // COUNT
- return llvm::prior(I);
+ return I;
}
MachineBasicBlock::iterator
@@ -220,7 +220,7 @@ private:
for (MachineBasicBlock::iterator E = MBB.end(); I != E; ++I) {
if (IsTrivialInst(I))
continue;
- if (isFetch(I))
+ if (!isFetch(I))
break;
AluInstCount ++;
if (AluInstCount > 7)
@@ -230,7 +230,7 @@ private:
.addImm(0) // ADDR
.addImm(0) // OP
.addImm(AluInstCount); // COUNT
- return llvm::prior(I);
+ return I;
}
public:
@@ -244,15 +244,13 @@ public:
MachineBasicBlock::iterator I = MBB.begin();
if (I->getOpcode() == AMDGPU::CF_ALU)
continue; // BB was already parsed
- for (MachineBasicBlock::iterator E = MBB.end(); I != E; ++I) {
- if (IsTrivialInst(I))
- continue;
+ for (MachineBasicBlock::iterator E = MBB.end(); I != E;) {
if (isALU(I))
I = MakeALUClause(MBB, I);
else if (isFetch(I))
I = MakeFetchClause(MBB,I);
else
- continue;
+ ++I;
}
}
return false;