void start_new_region ();
+ template<typename T>
+ void record_live_range_failure (T);
+
allocno_group_info *create_allocno_group (unsigned int, unsigned int);
allocno_subgroup get_allocno_subgroup (rtx);
void record_fpr_use (unsigned int);
// current function.
unsigned int m_call_preserved_fprs;
+ // True if we have so far been able to track the live ranges of individual
+ // allocnos.
+ bool m_accurate_live_ranges;
+
// True if we haven't yet failed to allocate the current region.
bool m_allocation_successful;
m_dead_insns.truncate (0);
m_allocated_fprs = 0;
m_call_preserved_fprs = 0;
+ m_accurate_live_ranges = true;
m_allocation_successful = true;
m_current_region += 1;
}
+// Record that we can no longer track the liveness of individual allocnos.
+// Call DUMP to dump the reason to a dump file.
+template<typename T>
+void
+early_ra::record_live_range_failure (T dump)
+{
+ if (!m_accurate_live_ranges)
+ return;
+
+ m_accurate_live_ranges = false;
+ m_allocation_successful = false;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Unable to track live ranges further: ");
+ dump ();
+ fprintf (dump_file, "\n");
+ }
+}
+
// Create and return an allocno group of size SIZE for register REGNO.
// REGNO can be INVALID_REGNUM if the group just exists to allow
// other groups to be chained together, and does not have any new
if (!targetm.modes_tieable_p (GET_MODE (SUBREG_REG (reg)),
GET_MODE (reg)))
{
- m_allocation_successful = false;
+ record_live_range_failure ([&](){
+ fprintf (dump_file, "cannot refer to r%d:%s in mode %s",
+ REGNO (SUBREG_REG (reg)),
+ GET_MODE_NAME (GET_MODE (SUBREG_REG (reg))),
+ GET_MODE_NAME (GET_MODE (reg)));
+ });
return {};
}
SUBREG_BYTE (reg), GET_MODE (reg), &info);
if (!info.representable_p)
{
- m_allocation_successful = false;
+ record_live_range_failure ([&](){
+ fprintf (dump_file, "subreg of r%d is invalid for V0",
+ REGNO (SUBREG_REG (reg)));
+ });
return {};
}