Commit 7450506b by Richard Sandiford Committed by Richard Sandiford

Remove global call sets: haifa-sched.c

The code patched here is counting how many registers the current
function would need to save in the prologue before it uses them.
The code is called per function, so using crtl is OK.

2019-09-30  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* 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.

From-SVN: r276324
parent a4dfaad2
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.
(compute_hash_table_work): Use insn_callee_abi to get the ABI of
the call insn target. Invalidate partially call-clobbered
......
......@@ -146,6 +146,7 @@ along with GCC; see the file COPYING3. If not see
#include "cfgloop.h"
#include "dumpfile.h"
#include "print-rtl.h"
#include "function-abi.h"
#ifdef INSN_SCHEDULING
......@@ -939,7 +940,8 @@ static bitmap tmp_bitmap;
/* 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];
......@@ -7207,10 +7209,13 @@ alloc_global_sched_pressure_data (void)
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];
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment