aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp
index aafc7cb1a8c..c1c82788756 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp
@@ -323,10 +323,14 @@ unsigned int
Function::orderInstructions(ArrayList &result)
{
Iterator *iter;
- for (iter = cfg.iteratorCFG(); !iter->end(); iter->next())
- for (Instruction *insn = BasicBlock::get(*iter)->getFirst();
- insn; insn = insn->next)
+ for (iter = cfg.iteratorCFG(); !iter->end(); iter->next()) {
+ BasicBlock *bb =
+ BasicBlock::get(reinterpret_cast<Graph::Node *>(iter->get()));
+
+ for (Instruction *insn = bb->getFirst(); insn; insn = insn->next)
result.insert(insn, insn->serial);
+ }
+
cfg.putIterator(iter);
return result.getSize();
}