From d15bfdf0a7d14f1c93dd425dd6aca51205fe2b6c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 31 Jul 2025 08:35:36 -0400 Subject: [PATCH] agx: track block divergence conservative for now. we'll need this for correctness. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compile.c | 3 +++ src/asahi/compiler/agx_compiler.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 63740517b39..165ae4fd7c5 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -2560,6 +2560,9 @@ agx_create_block(agx_context *ctx) { agx_block *blk = rzalloc(ctx, agx_block); + /* This is conservative, TODO: divergence analysis */ + blk->divergent = ctx->total_nesting > 0; + util_dynarray_init(&blk->predecessors, blk); return blk; diff --git a/src/asahi/compiler/agx_compiler.h b/src/asahi/compiler/agx_compiler.h index 2bdf1e64ce5..210f6ca7fa8 100644 --- a/src/asahi/compiler/agx_compiler.h +++ b/src/asahi/compiler/agx_compiler.h @@ -452,6 +452,9 @@ typedef struct agx_block { struct util_dynarray predecessors; bool unconditional_jumps; + /* Could there be masked execution? */ + bool divergent; + /* Liveness analysis results */ BITSET_WORD *live_in; BITSET_WORD *live_out;