+2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
+
+ * haifa-sched.c: Include function-abi.h.
+ (alloc_global_sched_pressure_data): Use crtl->abi to check whether
+ the function would need to save a register before using it.
+
2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
* gcse.c: Include function-abi.h.
#include "cfgloop.h"
#include "dumpfile.h"
#include "print-rtl.h"
+#include "function-abi.h"
#ifdef INSN_SCHEDULING
/* Effective number of available registers of a given class (see comment
in sched_pressure_start_bb). */
static int sched_class_regs_num[N_REG_CLASSES];
-/* Number of call_saved_regs and fixed_regs. Helpers for calculating of
+/* The number of registers that the function would need to save before it
+ uses them, and the number of fixed_regs. Helpers for calculating of
sched_class_regs_num. */
static int call_saved_regs_num[N_REG_CLASSES];
static int fixed_regs_num[N_REG_CLASSES];
fixed_regs_num[cl] = 0;
for (int i = 0; i < ira_class_hard_regs_num[cl]; ++i)
- if (!call_used_or_fixed_reg_p (ira_class_hard_regs[cl][i]))
- ++call_saved_regs_num[cl];
- else if (fixed_regs[ira_class_hard_regs[cl][i]])
- ++fixed_regs_num[cl];
+ {
+ unsigned int regno = ira_class_hard_regs[cl][i];
+ if (fixed_regs[regno])
+ ++fixed_regs_num[cl];
+ else if (!crtl->abi->clobbers_full_reg_p (regno))
+ ++call_saved_regs_num[cl];
+ }
}
}
}