From 568e948d1fda10d825cf99f3cb05609c4ff248bd Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 23 Feb 2020 11:52:02 -0800 Subject: [PATCH] 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: --- src/freedreno/ir3/ir3_print.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: "); -- 2.30.2