return set;
}
+use_info *
+function_info::create_use (obstack_watermark &watermark,
+ insn_info *insn,
+ set_info *set)
+{
+ auto use = change_alloc<use_info> (watermark, insn, set->resource (), set);
+ use->m_is_temp = true;
+ return use;
+}
+
// Return true if ACCESS1 can represent ACCESS2 and if ACCESS2 can
// represent ACCESS1.
static bool
m_temp_uses[i] = use = allocate<use_info> (*use);
use->m_is_temp = false;
set_info *def = use->def ();
- // Handle cases in which the value was previously not used
- // within the block.
- if (def && def->m_is_temp)
+ if (!def || !def->m_is_temp)
+ continue;
+
+ if (auto phi = dyn_cast<phi_info *> (def))
{
- phi_info *phi = as_a<phi_info *> (def);
+ // Handle cases in which the value was previously not used
+ // within the block.
gcc_assert (phi->is_degenerate ());
phi = create_degenerate_phi (phi->ebb (), phi->input_value (0));
use->set_def (phi);
}
+ else
+ {
+ // The temporary def may also be a set added with this change, in
+ // which case the permanent set is stored in the last_def link,
+ // and we need to update the use to refer to the permanent set.
+ gcc_assert (is_a<set_info *> (def));
+ auto perm_set = as_a<set_info *> (def->last_def ());
+ gcc_assert (!perm_set->is_temporary ());
+ use->set_def (perm_set);
+ }
}
}
insn_info *insn,
resource_info resource);
+ // Create a temporary use of SET as part of a change to INSN.
+ // SET can be a pre-existing definition or one that is being created
+ // as part of the same change group.
+ use_info *create_use (obstack_watermark &watermark,
+ insn_info *insn,
+ set_info *set);
+
// Create a temporary insn with code INSN_CODE and pattern PAT.
insn_info *create_insn (obstack_watermark &watermark,
rtx_code insn_code,