diff options
author | Ilia Mirkin <[email protected]> | 2015-07-01 02:11:39 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-07-01 02:50:43 -0400 |
commit | 5dcb28c3d26828ed1b0e2bd5a0589c5baab04b85 (patch) | |
tree | 16abb746ced331cb2ab82752724b258ae93e563e /src | |
parent | 4caaa2681e727fa6405ff6de6d1f6c6a356ede34 (diff) |
nv50/ir: copy joinAt when splitting both before and after
The current implementation only moves the joinAt when splitting after
the given instruction, not before it. So if you have a BB with
foo
instr
bar
joinat
and thus with joinAt set, we end up first splitting before instr, at
which point the instr's bb is updated to the new bb. Since that bb
doesn't have a joinAt set (despite containing one), when splitting after
the instr, there is nothing to copy over. Since the joinat will be in
the "split" bb irrespective of whether we're splitting before or after
the instruction, move it over in either case.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91124
Signed-off-by: Ilia Mirkin <[email protected]>
Cc: "10.5 10.6" <[email protected]>
Diffstat (limited to 'src')
3 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp index 51b9225156b..fa8ee072a92 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp @@ -332,6 +332,9 @@ BasicBlock::splitBefore(Instruction *insn, bool attach) BasicBlock *bb = new BasicBlock(func); assert(!insn || insn->op != OP_PHI); + bb->joinAt = joinAt; + joinAt = NULL; + splitCommon(insn, bb, attach); return bb; } diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp index ecd115f9807..9839a0e7bce 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp @@ -1687,6 +1687,7 @@ Converter::insertConvergenceOps(BasicBlock *conv, BasicBlock *fork) join->fixed = 1; conv->insertHead(join); + assert(!fork->joinAt); fork->joinAt = new_FlowInstruction(func, OP_JOINAT, conv); fork->insertBefore(fork->getExit(), fork->joinAt); } diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp index 2c7f7e326b2..bea293bac99 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp @@ -871,6 +871,7 @@ NV50LoweringPreSSA::handleTXL(TexInstruction *i) BasicBlock *joinBB = i->bb->splitAfter(i); bld.setPosition(currBB, true); + assert(!currBB->joinAt); currBB->joinAt = bld.mkFlow(OP_JOINAT, joinBB, CC_ALWAYS, NULL); for (int l = 0; l <= 3; ++l) { |