From: Rob Clark Date: Sun, 23 Feb 2020 19:52:02 +0000 (-0800) Subject: freedreno/ir3: allow block->predecessors to be null X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=568e948d1fda10d825cf99f3cb05609c4ff248bd;p=mesa.git freedreno/ir3: allow block->predecessors to be null This way we can also use ir3_print from computerator, which mostly bypasses the ir3_block construct (since it doesn't need to do scheduling, etc) Signed-off-by: Rob Clark Part-of: --- diff --git a/src/freedreno/ir3/ir3_print.c b/src/freedreno/ir3/ir3_print.c index 381319311a3..a19b8b3629b 100644 --- a/src/freedreno/ir3/ir3_print.c +++ b/src/freedreno/ir3/ir3_print.c @@ -273,7 +273,10 @@ print_block(struct ir3_block *block, int lvl) { tab(lvl); printf("block%u {\n", block_id(block)); - if (block->predecessors->entries > 0) { + /* computerator (ir3 assembler) doesn't really use blocks for flow + * control, so block->predecessors will be null. + */ + if (block->predecessors && block->predecessors->entries > 0) { unsigned i = 0; tab(lvl+1); printf("pred: ");