diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2013-06-06 20:05:16 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2013-06-06 20:05:16 +0000 |
commit | 3597e1135e5dce1fa8a7d69d933ae5dea2177591 (patch) | |
tree | c21b26315cc4a140b4b4bd538d318b01ccec686a /gcc | |
parent | 01037aeb478abb6c6c06c07c7368eead9032b677 (diff) | |
download | gcc-3597e1135e5dce1fa8a7d69d933ae5dea2177591.zip gcc-3597e1135e5dce1fa8a7d69d933ae5dea2177591.tar.gz gcc-3597e1135e5dce1fa8a7d69d933ae5dea2177591.tar.bz2 |
s390.opt (mlra): New option.
2013-06-06 Vladimir Makarov <vmakarov@redhat.com>
* config/s390/s390.opt (mlra): New option.
* config/s390/s390.c (s390_decompose_address): Check displacement
for all registers for LRA.
(s390_secondary_reload): Don't used secondary reloads for LRA.
(s390_lra_p): New function.
(TARGET_LRA_P): Define.
* config/s390/s390.md (*movmem_short, *clrmem_short): Change value
of attribute cpu_facility to zarch for the last alternative.
(*cmpmem_short): Ditto.
From-SVN: r199754
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 34 | ||||
-rw-r--r-- | gcc/config/s390/s390.md | 6 | ||||
-rw-r--r-- | gcc/config/s390/s390.opt | 4 |
4 files changed, 44 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 787da6f..6fe6b6d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2013-06-06 Vladimir Makarov <vmakarov@redhat.com> + + * config/s390/s390.opt (mlra): New option. + * config/s390/s390.c (s390_decompose_address): Check displacement + for all registers for LRA. + (s390_secondary_reload): Don't used secondary reloads for LRA. + (s390_lra_p): New function. + (TARGET_LRA_P): Define. + * config/s390/s390.md (*movmem_short, *clrmem_short): Change value + of attribute cpu_facility to zarch for the last alternative. + (*cmpmem_short): Ditto. + 2013-06-06 Eric Botcazou <ebotcazou@adacore.com> * config/arm/arm.c (arm_r3_live_at_start_p): New predicate. diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 30c3490..358345a 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -2017,14 +2017,18 @@ s390_decompose_address (rtx addr, struct s390_address *out) Thus we don't check the displacement for validity here. If after elimination the displacement turns out to be invalid after all, this is fixed up by reload in any case. */ - if (base != arg_pointer_rtx - && indx != arg_pointer_rtx - && base != return_address_pointer_rtx - && indx != return_address_pointer_rtx - && base != frame_pointer_rtx - && indx != frame_pointer_rtx - && base != virtual_stack_vars_rtx - && indx != virtual_stack_vars_rtx) + /* LRA maintains always displacements up to date and we need to + know the displacement is right during all LRA not only at the + final elimination. */ + if (lra_in_progress + || (base != arg_pointer_rtx + && indx != arg_pointer_rtx + && base != return_address_pointer_rtx + && indx != return_address_pointer_rtx + && base != frame_pointer_rtx + && indx != frame_pointer_rtx + && base != virtual_stack_vars_rtx + && indx != virtual_stack_vars_rtx)) if (!DISP_IN_RANGE (offset)) return false; } @@ -3189,7 +3193,9 @@ s390_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i, /* We need a scratch register when loading a PLUS expression which is not a legitimate operand of the LOAD ADDRESS instruction. */ - if (in_p && s390_plus_operand (x, mode)) + /* LRA can deal with transformation of plus op very well -- so we + don't need to prompt LRA in this case. */ + if (! lra_in_progress && in_p && s390_plus_operand (x, mode)) sri->icode = (TARGET_64BIT ? CODE_FOR_reloaddi_plus : CODE_FOR_reloadsi_plus); @@ -7868,6 +7874,13 @@ s390_class_max_nregs (enum reg_class rclass, enum machine_mode mode) return (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; } +/* Return true if we use LRA instead of reload pass. */ +static bool +s390_lra_p (void) +{ + return s390_lra_flag; +} + /* Return true if register FROM can be eliminated via register TO. */ static bool @@ -11105,6 +11118,9 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop) #undef TARGET_LEGITIMATE_CONSTANT_P #define TARGET_LEGITIMATE_CONSTANT_P s390_legitimate_constant_p +#undef TARGET_LRA_P +#define TARGET_LRA_P s390_lra_p + #undef TARGET_CAN_ELIMINATE #define TARGET_CAN_ELIMINATE s390_can_eliminate diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index cad4f5f..9279dfa 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -2690,7 +2690,7 @@ "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)" "#" [(set_attr "type" "cs") - (set_attr "cpu_facility" "*,*,z10,*")]) + (set_attr "cpu_facility" "*,*,z10,zarch")]) (define_split [(set (match_operand:BLK 0 "memory_operand" "") @@ -2899,7 +2899,7 @@ "(GET_MODE (operands[1]) == Pmode || GET_MODE (operands[1]) == VOIDmode)" "#" [(set_attr "type" "cs") - (set_attr "cpu_facility" "*,*,z10,*")]) + (set_attr "cpu_facility" "*,*,z10,zarch")]) (define_split [(set (match_operand:BLK 0 "memory_operand" "") @@ -3075,7 +3075,7 @@ "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)" "#" [(set_attr "type" "cs") - (set_attr "cpu_facility" "*,*,z10,*")]) + (set_attr "cpu_facility" "*,*,z10,zarch")]) (define_split [(set (reg:CCU CC_REGNUM) diff --git a/gcc/config/s390/s390.opt b/gcc/config/s390/s390.opt index b326441..ba38e6e 100644 --- a/gcc/config/s390/s390.opt +++ b/gcc/config/s390/s390.opt @@ -149,3 +149,7 @@ Target Report Joined RejectNegative UInteger Var(s390_branch_cost) Init(1) Set the branch costs for conditional branch instructions. Reasonable values are small, non-negative integers. The default branch cost is 1. + +mlra +Target Report Var(s390_lra_flag) Init(1) Save +Use LRA instead of reload |