Mesa (master): freedreno/ir3: allow block->predecessors to be null

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Feb 24 21:50:11 UTC 2020


Module: Mesa
Branch: master
Commit: 568e948d1fda10d825cf99f3cb05609c4ff248bd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=568e948d1fda10d825cf99f3cb05609c4ff248bd

Author: Rob Clark <robdclark at chromium.org>
Date:   Sun Feb 23 11:52:02 2020 -0800

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 at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3926>

---

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



More information about the mesa-commit mailing list