This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: patch for machine dependent rtl section to hide case statements for different types of constants.


Kenneth Zadeck <zadeck@naturalbridge.com> writes:
> The omission of CONST_FIXED from the cselib_expand_value_rtx_1,
> attr_copy_rtx, clear_struct_flag and combine switches looks
> unintentional (though only as a missed compiler-speed optimisation).
> Same goes for the omission of CONST_VECTOR from check_maybe_invariant.
>
> The omission of CONST_FIXED from dse.c:const_or_frame_p looks like
> a missed target-code optimisation.  The function ought to be using
> CONSTANT_P instead.
>
> ==== I did not do what is suggested in the last sentence because
> ==== it changes the behavior of the rtx "HIGH".

As mentioned privately, that's what we want.

> 1) Define:
>
> /* Match CONST_*s that can represent compile-time constant integers.  */
> #define CASE_CONST_SCALAR_INT \
>    case CONST_INT: \
>    case CONST_DOUBLE
>
> /* Match CONST_*s for which pointer equality corresponds to value 
> equality.  */
> #define CASE_CONST_UNIQUE \
>    case CONST_INT: \
>    case CONST_DOUBLE: \
>    case CONST_FIXED
>
> /* Match all CONST_* rtxes.  */
> #define CASE_CONST_ANY \
>    case CONST_INT: \
>    case CONST_DOUBLE: \
>    case CONST_FIXED: \
>    case CONST_VECTOR
>
> and remove the mark_jump_label_1 cases.

I meant that these three should be the _only_ cases we need.
The reason I listed all those missed cases was that, with the
exception of mark_jump_label_1, the switches really seemed to be
testing one of the three conditions above.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]