From 97e5181fe47e5b732262750fd67129c72366876d Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 10 Feb 2021 11:47:03 -0500 Subject: [PATCH] pan/bi: Add bi_is_ssa helper Convenient for SSA-based opt passes. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/bifrost/compiler.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 35203838298..ec04f529d0d 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -231,6 +231,12 @@ bi_is_null(bi_index idx) return idx.type == BI_INDEX_NULL; } +static inline bool +bi_is_ssa(bi_index idx) +{ + return idx.type == BI_INDEX_NORMAL && !idx.reg; +} + /* Compares equivalence as references. Does not compare offsets, swizzles, or * modifiers. In other words, this forms bi_index equivalence classes by * partitioning memory. E.g. -abs(foo[1].yx) == foo.xy but foo != bar */