diff options
author | David Malcolm <dmalcolm@redhat.com> | 2014-08-27 20:21:56 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2014-08-27 20:21:56 +0000 |
commit | 9e3090e11260968e1bc2af530b3ed339fb43db16 (patch) | |
tree | c98db4e91f44be888f5e27751c67882fc0a4d817 /gcc | |
parent | 33d9cde485f08edc7ada941aef9229312f38f8ed (diff) | |
download | gcc-9e3090e11260968e1bc2af530b3ed339fb43db16.zip gcc-9e3090e11260968e1bc2af530b3ed339fb43db16.tar.gz gcc-9e3090e11260968e1bc2af530b3ed339fb43db16.tar.bz2 |
reorg.c: Use rtx_sequence
gcc/
2014-08-27 David Malcolm <dmalcolm@redhat.com>
* reorg.c (redundant_insn): In two places in the function, replace
a check of GET_CODE with a dyn_cast, introducing local "seq", and
usings methods of rtx_sequence to clarify the code.
From-SVN: r214597
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/reorg.c | 24 |
2 files changed, 18 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4b84f5c..712914e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2014-08-27 David Malcolm <dmalcolm@redhat.com> + * reorg.c (redundant_insn): In two places in the function, replace + a check of GET_CODE with a dyn_cast, introducing local "seq", and + usings methods of rtx_sequence to clarify the code. + +2014-08-27 David Malcolm <dmalcolm@redhat.com> + * jump.c (mark_jump_label_1): Within the SEQUENCE case, introduce local "seq" with a checked cast, and use methods of rtx_sequence to clarify the code. diff --git a/gcc/reorg.c b/gcc/reorg.c index 1890845..75e787a 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -1526,11 +1526,11 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER) continue; - if (GET_CODE (pat) == SEQUENCE) + if (rtx_sequence *seq = dyn_cast <rtx_sequence *> (pat)) { /* Stop for a CALL and its delay slots because it is difficult to track its resource needs correctly. */ - if (CALL_P (XVECEXP (pat, 0, 0))) + if (CALL_P (seq->element (0))) return 0; /* Stop for an INSN or JUMP_INSN with delayed effects and its delay @@ -1538,21 +1538,21 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) correctly. */ #ifdef INSN_SETS_ARE_DELAYED - if (INSN_SETS_ARE_DELAYED (XVECEXP (pat, 0, 0))) + if (INSN_SETS_ARE_DELAYED (seq->element (0))) return 0; #endif #ifdef INSN_REFERENCES_ARE_DELAYED - if (INSN_REFERENCES_ARE_DELAYED (XVECEXP (pat, 0, 0))) + if (INSN_REFERENCES_ARE_DELAYED (seq->element (0))) return 0; #endif /* See if any of the insns in the delay slot match, updating resource requirements as we go. */ - for (i = XVECLEN (pat, 0) - 1; i > 0; i--) - if (GET_CODE (XVECEXP (pat, 0, i)) == GET_CODE (insn) - && rtx_equal_p (PATTERN (XVECEXP (pat, 0, i)), ipat) - && ! find_reg_note (XVECEXP (pat, 0, i), REG_UNUSED, NULL_RTX)) + for (i = seq->len () - 1; i > 0; i--) + if (GET_CODE (seq->element (i)) == GET_CODE (insn) + && rtx_equal_p (PATTERN (seq->element (i)), ipat) + && ! find_reg_note (seq->element (i), REG_UNUSED, NULL_RTX)) break; /* If found a match, exit this loop early. */ @@ -1628,10 +1628,10 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER) continue; - if (GET_CODE (pat) == SEQUENCE) + if (rtx_sequence *seq = dyn_cast <rtx_sequence *> (pat)) { bool annul_p = false; - rtx control = XVECEXP (pat, 0, 0); + rtx control = seq->element (0); /* If this is a CALL_INSN and its delay slots, it is hard to track the resource needs properly, so give up. */ @@ -1656,9 +1656,9 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) /* See if any of the insns in the delay slot match, updating resource requirements as we go. */ - for (i = XVECLEN (pat, 0) - 1; i > 0; i--) + for (i = seq->len () - 1; i > 0; i--) { - rtx candidate = XVECEXP (pat, 0, i); + rtx candidate = seq->element (i); /* If an insn will be annulled if the branch is false, it isn't considered as a possible duplicate insn. */ |