diff mbox

RFA: Store the REG_BR_PROB probability directly as an int

Message ID 87fvsuf7l0.fsf@talisman.default
State New
Headers show

Commit Message

Richard Sandiford Sept. 24, 2013, 5:33 p.m. UTC
Andreas Schwab <schwab@suse.de> writes:
> Richard Sandiford <rdsandiford@googlemail.com> writes:
>
>> REG_BR_PROB notes are stored as:
>>
>>   (expr_list:REG_BR_PROB (const_int <prob>) <chain>)
>>
>> but a full const_int rtx seems a bit heavweight when all we want is
>> a plain "int".  This patch uses:
>>
>>   (int_list:REG_BR_PROB <prob> <chain>)
>>
>> instead.
>
> I think you left out the handling of INT_LIST in eliminate_regs_1.  This
> lets me finish the build:

Sorry for the breakage.  I think we need to handle INT_LIST in the same way
as INSN_LIST though, and eliminate in XEXP (x, 1).

How about the attached?  Testing in progress...

Thanks,
Richard


gcc/
	* cse.c (count_reg_usage): Handle INT_LIST.
	* lra-eliminations.c (lra_eliminate_regs_1): Likewise.
	* reginfo.c (reg_scan_mark_refs): Likewise.
	* reload1.c (eliminate_regs_1): Likewise.

Comments

Andreas Schwab Sept. 24, 2013, 7:07 p.m. UTC | #1
Richard Sandiford <rdsandiford@googlemail.com> writes:

> Sorry for the breakage.  I think we need to handle INT_LIST in the same way
> as INSN_LIST though, and eliminate in XEXP (x, 1).
>
> How about the attached?  Testing in progress...

Works for me as well.

Andreas.
Steve Ellcey Sept. 25, 2013, 3:54 p.m. UTC | #2
On Tue, 2013-09-24 at 21:07 +0200, Andreas Schwab wrote:
> Richard Sandiford <rdsandiford@googlemail.com> writes:
> 
> > Sorry for the breakage.  I think we need to handle INT_LIST in the same way
> > as INSN_LIST though, and eliminate in XEXP (x, 1).
> >
> > How about the attached?  Testing in progress...
> 
> Works for me as well.
> 
> Andreas.

This patch worked for me as well on MIPS.  I did a complete build and
test overnight.

Steve Ellcey
sellcey@mips.com
Richard Sandiford Sept. 26, 2013, 4:24 p.m. UTC | #3
Steve Ellcey <sellcey@mips.com> writes:
> On Tue, 2013-09-24 at 21:07 +0200, Andreas Schwab wrote:
>> Richard Sandiford <rdsandiford@googlemail.com> writes:
>> 
>> > Sorry for the breakage.  I think we need to handle INT_LIST in the same way
>> > as INSN_LIST though, and eliminate in XEXP (x, 1).
>> >
>> > How about the attached?  Testing in progress...
>> 
>> Works for me as well.
>> 
>> Andreas.
>
> This patch worked for me as well on MIPS.  I did a complete build and
> test overnight.

Thanks for the testing.  It also passes bootstrap on x86_64-linux-gnu.
OK to install?

Thanks,
Richard
Eric Botcazou Sept. 27, 2013, 8:41 a.m. UTC | #4
> Thanks for the testing.  It also passes bootstrap on x86_64-linux-gnu.
> OK to install?

Yes, thanks.
diff mbox

Patch

Index: gcc/cse.c
===================================================================
--- gcc/cse.c	2013-09-24 18:29:49.308378918 +0100
+++ gcc/cse.c	2013-09-24 18:29:49.460380403 +0100
@@ -6739,6 +6739,7 @@  count_reg_usage (rtx x, int *counts, rtx
       return;
 
     case INSN_LIST:
+    case INT_LIST:
       gcc_unreachable ();
 
     default:
Index: gcc/lra-eliminations.c
===================================================================
--- gcc/lra-eliminations.c	2013-09-24 18:29:49.308378918 +0100
+++ gcc/lra-eliminations.c	2013-09-24 18:29:49.461380412 +0100
@@ -471,6 +471,7 @@  lra_eliminate_regs_1 (rtx x, enum machin
       /* ... fall through ...  */
 
     case INSN_LIST:
+    case INT_LIST:
       /* Now do eliminations in the rest of the chain.	If this was
 	 an EXPR_LIST, this might result in allocating more memory than is
 	 strictly needed, but it simplifies the code.  */
Index: gcc/reginfo.c
===================================================================
--- gcc/reginfo.c	2013-09-24 18:29:49.309378928 +0100
+++ gcc/reginfo.c	2013-09-24 18:29:49.462380422 +0100
@@ -1075,6 +1075,7 @@  reg_scan_mark_refs (rtx x, rtx insn)
       break;
 
     case INSN_LIST:
+    case INT_LIST:
       if (XEXP (x, 1))
 	reg_scan_mark_refs (XEXP (x, 1), insn);
       break;
Index: gcc/reload1.c
===================================================================
--- gcc/reload1.c	2013-09-24 18:29:49.311378947 +0100
+++ gcc/reload1.c	2013-09-24 18:29:49.463380432 +0100
@@ -2776,6 +2776,7 @@  eliminate_regs_1 (rtx x, enum machine_mo
       /* ... fall through ...  */
 
     case INSN_LIST:
+    case INT_LIST:
       /* Now do eliminations in the rest of the chain.  If this was
 	 an EXPR_LIST, this might result in allocating more memory than is
 	 strictly needed, but it simplifies the code.  */