nvc0/ir: fix default insertion position in pre-SSA lowering pass
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Fri, 6 Jan 2012 21:19:42 +0000 (22:19 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Mon, 9 Jan 2012 23:36:46 +0000 (00:36 +0100)
Always set position to insert before the current instruction,
the previous behaviour led to confusion (bug in checkPredicate
for BBs with only a single conditional branch).

src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp

index 6faef9b68ca5dc26bba8f179e4df7a05fadc27ff..e4d32d0a678107f46893c6449aef5b1f6006d84a 100644 (file)
@@ -657,13 +657,7 @@ NVC0LoweringPass::checkPredicate(Instruction *insn)
 bool
 NVC0LoweringPass::visit(Instruction *i)
 {
-   if (i->prev)
-      bld.setPosition(i->prev, true);
-   else
-   if (i->next)
-      bld.setPosition(i->next, false);
-   else
-      bld.setPosition(i->bb, true);
+   bld.setPosition(i, false);
 
    if (i->cc != CC_ALWAYS)
       checkPredicate(i);