return src;
}
+static inline nir_instr *
+nir_src_get_parent_instr(const nir_src *src)
+{
+ if (src->is_ssa) {
+ return src->ssa->parent_instr;
+ } else {
+ return src->reg.reg->parent_instr;
+ }
+}
+
static inline nir_dest
nir_dest_for_reg(nir_register *reg)
{
static uint8_t
get_resolve_status_for_src(nir_src *src)
{
- nir_instr *src_instr;
- if (src->is_ssa) {
- src_instr = src->ssa->parent_instr;
- } else {
- src_instr = src->reg.reg->parent_instr;
- }
-
+ nir_instr *src_instr = nir_src_get_parent_instr(src);
if (src_instr) {
uint8_t resolve_status = src_instr->pass_flags & BRW_NIR_BOOLEAN_MASK;
static bool
src_mark_needs_resolve(nir_src *src, void *void_state)
{
- nir_instr *src_instr;
- if (src->is_ssa) {
- src_instr = src->ssa->parent_instr;
- } else {
- src_instr = src->reg.reg->parent_instr;
- }
-
+ nir_instr *src_instr = nir_src_get_parent_instr(src);
if (src_instr) {
uint8_t resolve_status = src_instr->pass_flags & BRW_NIR_BOOLEAN_MASK;