diff options
author | Bernd Schmidt <bernds@redhat.com> | 2000-12-29 18:18:50 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2000-12-29 18:18:50 +0000 |
commit | b5d37c6fc281d909a3fac80266a8e1d93e096efc (patch) | |
tree | 83fca660c67beb768b53a9b3ca10b0065fcfde03 /gcc | |
parent | de10dbf5be469ef56558e6a17e6912da56da57cf (diff) | |
download | gcc-b5d37c6fc281d909a3fac80266a8e1d93e096efc.zip gcc-b5d37c6fc281d909a3fac80266a8e1d93e096efc.tar.gz gcc-b5d37c6fc281d909a3fac80266a8e1d93e096efc.tar.bz2 |
Improve alias analysis on ia64
From-SVN: r38549
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/config/ia64/ia64-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.c | 19 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.md | 20 |
4 files changed, 37 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7da40b9..dcd8be9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,15 @@ 2000-12-29 Bernd Schmidt <bernds@redhat.com> + * ia64.c (ia64_expand_load_address): Accept additional scratch + register argument. All callers & prototype changed. + Use scratch register when generating load_symptr insns. + * ia64.md (movdi_symbolic): Clobber a scratch register. Use it + when calling ia64_expand_load_address. + (movdi): Generate movdi_symbolic with additional operand. + (load_gprel64): Use pic_offset_table_rtx instead of (reg:DI 1). + (load_symptr): Likewise. Use additional operand as a scratch + register instead of generating it here. + * basic-block.h: Add a comment. * flow.c (PROP_POSTRELOAD): New macro. (update_life_info): Add it to prop_flags. diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h index cb076c7..d3eefe6 100644 --- a/gcc/config/ia64/ia64-protos.h +++ b/gcc/config/ia64/ia64-protos.h @@ -81,7 +81,7 @@ extern void ia64_function_prologue PARAMS((FILE *, int)); extern void ia64_function_epilogue PARAMS((FILE *, int)); extern int ia64_direct_return PARAMS((void)); -extern void ia64_expand_load_address PARAMS((rtx, rtx)); +extern void ia64_expand_load_address PARAMS((rtx, rtx, rtx)); extern int ia64_hard_regno_rename_ok PARAMS((int, int)); extern void ia64_initialize_trampoline PARAMS((rtx, rtx, rtx)); diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 990fe62..d453866 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -798,8 +798,8 @@ ia64_depz_field_mask (rop, rshift) /* ??? Should generalize this, so that we can also support 32 bit pointers. */ void -ia64_expand_load_address (dest, src) - rtx dest, src; +ia64_expand_load_address (dest, src, scratch) + rtx dest, src, scratch; { rtx temp; @@ -831,11 +831,22 @@ ia64_expand_load_address (dest, src) lo = ((ofs & 0x3fff) ^ 0x2000) - 0x2000; hi = ofs - lo; - emit_insn (gen_load_symptr (subtarget, plus_constant (sym, hi))); + if (! scratch) + scratch = no_new_pseudos ? subtarget : gen_reg_rtx (DImode); + + emit_insn (gen_load_symptr (subtarget, plus_constant (sym, hi), + scratch)); emit_insn (gen_adddi3 (temp, subtarget, GEN_INT (lo))); } else - emit_insn (gen_load_symptr (temp, src)); + { + rtx insn; + if (! scratch) + scratch = no_new_pseudos ? temp : gen_reg_rtx (DImode); + + insn = emit_insn (gen_load_symptr (temp, src, scratch)); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, src, REG_NOTES (insn)); + } if (temp != dest) emit_move_insn (dest, temp); diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index 25660fe..fab9490 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -484,9 +484,9 @@ if (rtx_equal_function_value_matters && ! (GET_CODE (operands[1]) == SYMBOL_REF && SYMBOL_REF_FLAG (operands[1]))) - emit_insn (gen_movdi_symbolic (operands[0], operands[1])); + emit_insn (gen_movdi_symbolic (operands[0], operands[1], gen_reg_rtx (DImode))); else - ia64_expand_load_address (operands[0], operands[1]); + ia64_expand_load_address (operands[0], operands[1], NULL_RTX); DONE; } }") @@ -551,12 +551,13 @@ (define_insn_and_split "movdi_symbolic" [(set (match_operand:DI 0 "register_operand" "=r") (match_operand:DI 1 "symbolic_operand" "s")) + (clobber (match_operand:DI 2 "register_operand" "+r")) (use (reg:DI 1))] "" "* abort ();" "" [(const_int 0)] - "ia64_expand_load_address (operands[0], operands[1]); DONE;") + "ia64_expand_load_address (operands[0], operands[1], operands[2]); DONE;") (define_insn "*movdi_internal_astep" [(set (match_operand:DI 0 "destination_operand" @@ -640,7 +641,7 @@ [(const_int 0)] " { - ia64_expand_load_address (operands[0], operands[1]); + ia64_expand_load_address (operands[0], operands[1], NULL_RTX); DONE; }") @@ -679,24 +680,25 @@ (define_expand "load_gprel64" [(set (match_dup 2) - (minus:DI (match_operand:DI 1 "symbolic_operand" "") (reg:DI 1))) + (minus:DI (match_operand:DI 1 "symbolic_operand" "") (match_dup 3))) (set (match_operand:DI 0 "register_operand" "") - (plus:DI (reg:DI 1) (match_dup 2)))] + (plus:DI (match_dup 3) (match_dup 2)))] "" " { operands[2] = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode); + operands[3] = pic_offset_table_rtx; }") (define_expand "load_symptr" - [(set (match_dup 2) - (plus:DI (reg:DI 1) (match_operand:DI 1 "got_symbolic_operand" ""))) + [(set (match_operand:DI 2 "register_operand" "") + (plus:DI (match_dup 4) (match_operand:DI 1 "got_symbolic_operand" ""))) (set (match_operand:DI 0 "register_operand" "") (match_dup 3))] "" " { - operands[2] = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode); operands[3] = gen_rtx_MEM (DImode, operands[2]); + operands[4] = pic_offset_table_rtx; RTX_UNCHANGING_P (operands[3]) = 1; }") |