----- Original Message ----- From: "Jeff Law" <l...@redhat.com>
Sent: Friday, September 04, 2015 11:22 PM

Hello.



Index: gcc/cse.c
===================================================================
--- gcc/cse.c (revision 226953)
+++ gcc/cse.c (working copy)
@@ -463,7 +463,7 @@
A reg wins if it is either the frame pointer or designated as
fixed. */
#define FIXED_REGNO_P(N) \
((N) == FRAME_POINTER_REGNUM || (N) == HARD_FRAME_POINTER_REGNUM \
- || fixed_regs[N] || global_regs[N])
+ || TEST_HARD_REG_BIT (fixed_reg_set, N))
So why not continue to test fixed_regs here (ie, just drop the global_regs test)? It's a single memory reference and a test against zero.

Using TEST_HARD_REG_BIT likely still hits memory, but then on many architectures you're then going to have to do masking/shifting to get the bit you want to look at. That seems to me like a step backwards.

The fixed_regs array duplicate information from the fixed_reg_set. Мore
practical to use an HARD_REG_SET as there are many useful function as
hard_reg_set_subset_p, range_in_hard_reg_set_p, etc. I propose
to remove fixed_regs array use from GCC midle end and allow to use it in
TARGET_CONDITIONAL_REGISTER_USAGE target hook only. This will isolate
the bit the back end interface from the rest of GCC and simplify implementation
FIXED_REGISTERS target macro as target hook.

Anatoly.

Reply via email to