This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [IRA] some code improvement and s390 support
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: vmakarov at redhat dot com (Vladimir N. Makarov)
- Cc: gcc-patches at gcc dot gnu dot org (gcc-patches at gcc dot gnu dot org), krebbel at linux dot vnet dot ibm dot com
- Date: Mon, 1 Sep 2014 18:51:10 +0200 (CEST)
- Subject: Re: [IRA] some code improvement and s390 support
- Authentication-results: sourceware.org; auth=none
Vladmir Makarov wrote:
> * config/s390/s390.h (IRA_COVER_CLASSES,
> IRA_HARD_REGNO_ADD_COST_MULTIPLIER(regno)): Define.
In debugging PR 53854 I noticed a strange behavior in IRA costs
that seems to trace back to the very first definition of the
IRA_HARD_REGNO_ADD_COST_MULTIPLIER on s390:
> +/* In some case register allocation order is not enough for IRA to
> + generate a good code. The following macro (if defined) increases
> + cost of REGNO for a pseudo approximately by pseudo usage frequency
> + multiplied by the macro value.
> +
> + We avoid usage of BASE_REGNUM by nonzero macro value because the
> + reload can decide not to use the hard register because some
> + constant was forced to be in memory. */
> +#define IRA_HARD_REGNO_ADD_COST_MULTIPLIER(regno) \
> + (regno == BASE_REGNUM ? 0.0 : 0.5)
(which is still unchanged in current sources.)
Now, the comment says BASE_REGNUM should be avoided, but the actual
implementation of the macro seems to avoid *all* registers *but*
BASE_REGNUM ...
Am I misreading this, or is there indeed a logic error here?
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com