patch for machine independent rtl section to hide case statements for different types of constants.

Kenneth Zadeck zadeck@naturalbridge.com
Thu Aug 23 18:50:00 GMT 2012


All changes made as Richard requested.

Retested on x86-64.

committed as revision 190627

2012-08-23  Kenneth Zadeck <zadeck@naturalbridge.com>

     * alias.c (rtx_equal_for_memref_p): Convert constant cases.
     * combine.c (find_single_use_1, mark_used_regs_combine): Convert
     to CASE_CONST_ANY.
      * cse.c (exp_equiv_p, canon_reg, fold_rtx, cse_process_notes_1,
     count_reg_usage): Convert constant cases.
     * cselib.c (cselib_expand_value_rtx_1): Convert to
     CASE_CONST_ANY.
     (cselib_subst_to_values): Convert constant cases.
     * df-scan.c (df_uses_record): Ditto.
     * dse.c (const_or_frame_p): Convert case statements to explicit
     if-then-else using mode classes.
     * emit-rtl.c (verify_rtx_sharing, copy_insn_1): Convert constant cases.
     * explow.c (convert_memory_address_addr_space): Ditto.
     * gcse.c (want_to_gcse_p, oprs_unchanged_p, compute_transp): Ditto.
     * genattrtab.c (attr_copy_rtx, clear_struct_flag): Ditto.
     * ira.c (equiv_init_varies_p, contains_replace_regs,
     memref_referenced_p, rtx_moveable_p): Ditto.
     * jump.c (mark_jump_label_1): Remove constant cases.
     (rtx_renumbered_equal_p): Convert to CASE_CONST_UNIQUE.
     * loop-invariant.c (check_maybe_invariant, hash_invariant_expr_1,
     invariant_expr_equal_p): Convert to CASE_CONST_ANY.
     * postreload-gcse.c (oprs_unchanged_p): Convert constant cases.
     * reginfo.c (reg_scan_mark_refs): Ditto.
     * regrename.c (scan_rtx): Ditto.
     * reload1.c (eliminate_regs_1, elimination_effects,
     scan_paradoxical_subregs): Ditto.
     * reload.c (operands_match_p, subst_reg_equivs):  Ditto.
     * resource.c (mark_referenced_resources, mark_set_resources): Ditto.
     * rtlanal.c (rtx_unstable_p, rtx_varies_p, count_occurrences)
     (reg_mentioned_p, modified_between_p, modified_in_p)
     (volatile_insn_p, volatile_refs_p, side_effects_p, may_trap_p_1,
     inequality_comparisons_p, computed_jump_p_1): Ditto.
     * rtl.c (copy_rtx, rtx_equal_p_cb, rtx_equal_p): Ditto.
     * sched-deps.c (sched_analyze_2): Ditto.
     * valtrack.c (cleanup_auto_inc_dec): Ditto.
     * rtl.h: (CASE_CONST_SCALAR_INT, CASE_CONST_UNIQUE,
     CASE_CONST_ANY): New macros.



On 08/21/2012 12:56 PM, Richard Sandiford wrote:
> Kenneth Zadeck <zadeck@naturalbridge.com> writes:
>> I plan to commit this in a few days unless someone has some comments.
>> This is a mostly trivial patch and the changes from that are Richard
>> Sandiford's and he is an rtl maintainer.
> Please don't do this.  Patches need to be sent for review in their
> final form.  Obviously, having got this far with the patch, you're free
> to beat me up if I don't review it. :-)
>
> Anyway, please do call it CASE_CONST_SCALAR_INT rather than
> CASE_CONST_SCALAR_INTEGER.  Like I said in my original mail,
> CASE_CONST_SCALAR_INT chimes nicely with SCALAR_INT_MODE_P, etc.,
> and (as I didn't say) it'd be better not to have two spellings
> of the same thing.
>
>> diff -upNr '--exclude=.svn' gccBaseline/gcc/combine.c gccWCase/gcc/combine.c
>> --- gccBaseline/gcc/combine.c	2012-08-17 09:35:24.802195795 -0400
>> +++ gccWCase/gcc/combine.c	2012-08-20 15:43:34.659362244 -0400
>> @@ -531,12 +531,10 @@ find_single_use_1 (rtx dest, rtx *loc)
>>
>>     switch (code)
>>       {
>> -    case CONST_INT:
>>       case CONST:
>>       case LABEL_REF:
>>       case SYMBOL_REF:
>> -    case CONST_DOUBLE:
>> -    case CONST_VECTOR:
>> +    CASE_CONST_UNIQUE:
>>       case CLOBBER:
>>         return 0;
>>
>> @@ -12788,10 +12786,8 @@ mark_used_regs_combine (rtx x)
>>       {
>>       case LABEL_REF:
>>       case SYMBOL_REF:
>> -    case CONST_INT:
>>       case CONST:
>> -    case CONST_DOUBLE:
>> -    case CONST_VECTOR:
>> +    CASE_CONST_UNIQUE:
>>       case PC:
>>       case ADDR_VEC:
>>       case ADDR_DIFF_VEC:
> These were supposed to be CASE_CONST_ANY.  The omission of CONST_FIXED
> looks like an oversight.
>
>>     switch (code)
>>       {
>> -    case CONST_INT:
>> -    case CONST_DOUBLE:
>> -    case CONST_FIXED:
>> +    CASE_CONST_UNIQUE:
>>       case SYMBOL_REF:
>>       case CONST:
>>       case LABEL_REF:
> This was suppsoed to be CASE_CONST_ANY too.  The omission of CONST_VECTOR
> looks like an oversight.
>
>> +/* Match CONST_*s for which pointer equality corresponds to value
>> +equality.  */
> Should be:
>
> /* Match CONST_*s for which pointer equality corresponds to value equality.  */
>
> (probably an artefact of my work mailer, sorry)
>
>> +
>> +
>> +
> Rather a lot of whitespace there.  One line seems enough, since we're
> just before the definition of CONST_INT_P.
>
> OK with those changes, thanks.
>
> Richard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: case7.diff
Type: text/x-patch
Size: 22468 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120823/f1a2607b/attachment.bin>


More information about the Gcc-patches mailing list