aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-09-30 16:20:48 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-09-30 16:20:48 +0000
commit7450506b5d48642a71459cfc24efcea6ca58e97e (patch)
treebb5ef760e2227bbfc2748b3d40676f2bf09f9403 /gcc
parenta4dfaad2e5594d871fe00a1116005e28f95d644e (diff)
downloadgcc-7450506b5d48642a71459cfc24efcea6ca58e97e.zip
gcc-7450506b5d48642a71459cfc24efcea6ca58e97e.tar.gz
gcc-7450506b5d48642a71459cfc24efcea6ca58e97e.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/haifa-sched.c15
2 files changed, 16 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1b1c31c..12129b6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
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
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index dba3acf..7338050 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -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];
+ }
}
}
}