summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Schürmann <[email protected]>2019-12-04 13:41:37 +0100
committerDaniel Schürmann <[email protected]>2019-12-07 11:23:11 +0100
commit28c95cc40282c522ed0b89d1db2fd88b690f43b0 (patch)
tree771463cccd7c5de4a5ddb8a4eb267d9c26fe24c4 /src
parent0f9447ccb0445314e9e890772210e48352b4185c (diff)
aco: return to loop_active mask at continue_or_break blocks
Reviewed-by: Rhys Perry <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/compiler/aco_insert_exec_mask.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/amd/compiler/aco_insert_exec_mask.cpp b/src/amd/compiler/aco_insert_exec_mask.cpp
index 607b4f52793..606497302f7 100644
--- a/src/amd/compiler/aco_insert_exec_mask.cpp
+++ b/src/amd/compiler/aco_insert_exec_mask.cpp
@@ -914,20 +914,11 @@ void add_branch_code(exec_ctx& ctx, Block* block)
assert(block->instructions.back()->opcode == aco_opcode::p_branch);
block->instructions.pop_back();
- if (ctx.info[idx].exec.back().second & mask_type_loop) {
- bld.branch(aco_opcode::p_cbranch_nz, bld.exec(ctx.info[idx].exec.back().first), block->linear_succs[1], block->linear_succs[0]);
- } else {
- Temp cond = Temp();
- for (int exec_idx = ctx.info[idx].exec.size() - 1; exec_idx >= 0; exec_idx--) {
- if (ctx.info[idx].exec[exec_idx].second & mask_type_loop) {
- cond = bld.sopc(Builder::s_cmp_lg, bld.def(s1, scc), ctx.info[idx].exec[exec_idx].first, Operand(0u));
- break;
- }
- }
- assert(cond != Temp());
+ while (!(ctx.info[idx].exec.back().second & mask_type_loop))
+ ctx.info[idx].exec.pop_back();
- bld.branch(aco_opcode::p_cbranch_nz, bld.scc(cond), block->linear_succs[1], block->linear_succs[0]);
- }
+ ctx.info[idx].exec.back().first = bld.pseudo(aco_opcode::p_parallelcopy, bld.def(bld.lm, exec), ctx.info[idx].exec.back().first);
+ bld.branch(aco_opcode::p_cbranch_nz, bld.exec(ctx.info[idx].exec.back().first), block->linear_succs[1], block->linear_succs[0]);
return;
}