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 <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3926>
This commit is contained in:
Rob Clark 2020-02-23 11:52:02 -08:00 committed by Marge Bot
parent f87d412f08
commit 568e948d1f
1 changed files with 4 additions and 1 deletions

View File

@ -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: ");