This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch for machine dependent rtl section to hide case statements for different types of constants.
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Kenneth Zadeck <zadeck at naturalbridge dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Mike Stump <mikestump at comcast dot net>
- Date: Mon, 20 Aug 2012 17:20:34 +0100
- Subject: Re: patch for machine dependent rtl section to hide case statements for different types of constants.
- References: <503240A7.6030502@naturalbridge.com>
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