nvc0/ir: fix default insertion position in pre-SSA lowering pass

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).
This commit is contained in:
Christoph Bumiller 2012-01-06 22:19:42 +01:00
parent dc4c821f08
commit 405bd00f3c

View 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);