Commit d1457701 by Vladimir Makarov Committed by Vladimir Makarov

re PR rtl-optimization/64110 (ICE: Max. number of generated reload insns per insn is achieved (90))

2015-01-15  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/64110
	* stmt.c (parse_output_constraint): Process '^' and '$'.
	(parse_input_constraint): Ditto.
	* lra-constraints.c (process_alt_operands): Process the new
	constraints.
	* ira-costs.c (record_reg_classes): Process the new constraint
	'^'.
	* genoutput.c (indep_constraints): Add '^' and '$'.
	* config/i386/sse.md (*vec_dup<mode>): Use '$' instead of '!'.
	* doc/md.texi: Add description of the new constraints.

2015-01-15  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/64110
	* gcc.target/i386/pr64110.c: Add scan-assembler.

From-SVN: r219683
parent 41dbbb37
2015-01-15 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/64110
* stmt.c (parse_output_constraint): Process '^' and '$'.
(parse_input_constraint): Ditto.
* lra-constraints.c (process_alt_operands): Process the new
constraints.
* ira-costs.c (record_reg_classes): Process the new constraint
'^'.
* genoutput.c (indep_constraints): Add '^' and '$'.
* config/i386/sse.md (*vec_dup<mode>): Use '$' instead of '!'.
* doc/md.texi: Add description of the new constraints.
2015-01-15 Thomas Schwinge <thomas@codesourcery.com> 2015-01-15 Thomas Schwinge <thomas@codesourcery.com>
Bernd Schmidt <bernds@codesourcery.com> Bernd Schmidt <bernds@codesourcery.com>
Cesar Philippidis <cesar@codesourcery.com> Cesar Philippidis <cesar@codesourcery.com>
......
...@@ -16713,7 +16713,7 @@ ...@@ -16713,7 +16713,7 @@
(define_insn "*vec_dup<mode>" (define_insn "*vec_dup<mode>"
[(set (match_operand:AVX2_VEC_DUP_MODE 0 "register_operand" "=x,x,x") [(set (match_operand:AVX2_VEC_DUP_MODE 0 "register_operand" "=x,x,x")
(vec_duplicate:AVX2_VEC_DUP_MODE (vec_duplicate:AVX2_VEC_DUP_MODE
(match_operand:<ssescalarmode> 1 "nonimmediate_operand" "m,x,!r")))] (match_operand:<ssescalarmode> 1 "nonimmediate_operand" "m,x,$r")))]
"TARGET_AVX2" "TARGET_AVX2"
"@ "@
v<sseintprefix>broadcast<bcstscalarsuff>\t{%1, %0|%0, %1} v<sseintprefix>broadcast<bcstscalarsuff>\t{%1, %0|%0, %1}
......
...@@ -1507,6 +1507,18 @@ in it. ...@@ -1507,6 +1507,18 @@ in it.
Disparage severely the alternative that the @samp{!} appears in. Disparage severely the alternative that the @samp{!} appears in.
This alternative can still be used if it fits without reloading, This alternative can still be used if it fits without reloading,
but if reloading is needed, some other alternative will be used. but if reloading is needed, some other alternative will be used.
@cindex @samp{^} in constraint
@cindex caret
@item ^
This constraint is analogous to @samp{?} but it disparages slightly
the alternative only if the operand with the @samp{?} needs a reload.
@cindex @samp{$} in constraint
@cindex dollar sign
@item $
This constraint is analogous to @samp{!} but it disparages severely
the alternative only if the operand with the @samp{$} needs a reload.
@end table @end table
@ifset INTERNALS @ifset INTERNALS
......
...@@ -209,7 +209,7 @@ struct constraint_data ...@@ -209,7 +209,7 @@ struct constraint_data
/* All machine-independent constraint characters (except digits) that /* All machine-independent constraint characters (except digits) that
are handled outside the define*_constraint mechanism. */ are handled outside the define*_constraint mechanism. */
static const char indep_constraints[] = ",=+%*?!#&g"; static const char indep_constraints[] = ",=+%*?!^$#&g";
static struct constraint_data * static struct constraint_data *
constraints_by_letter_table[1 << CHAR_BIT]; constraints_by_letter_table[1 << CHAR_BIT];
......
...@@ -778,6 +778,10 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops, ...@@ -778,6 +778,10 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
c = *++p; c = *++p;
break; break;
case '^':
alt_cost += 2;
break;
case '?': case '?':
alt_cost += 2; alt_cost += 2;
break; break;
......
...@@ -1657,6 +1657,7 @@ process_alt_operands (int only_alternative) ...@@ -1657,6 +1657,7 @@ process_alt_operands (int only_alternative)
then REJECT is ignored, but otherwise it gets this much counted then REJECT is ignored, but otherwise it gets this much counted
against it in addition to the reloading needed. */ against it in addition to the reloading needed. */
int reject; int reject;
int op_reject;
/* The number of elements in the following array. */ /* The number of elements in the following array. */
int early_clobbered_regs_num; int early_clobbered_regs_num;
/* Numbers of operands which are early clobber registers. */ /* Numbers of operands which are early clobber registers. */
...@@ -1806,6 +1807,7 @@ process_alt_operands (int only_alternative) ...@@ -1806,6 +1807,7 @@ process_alt_operands (int only_alternative)
track. */ track. */
lra_assert (*p != 0 && *p != ','); lra_assert (*p != 0 && *p != ',');
op_reject = 0;
/* Scan this alternative's specs for this operand; set WIN /* Scan this alternative's specs for this operand; set WIN
if the operand fits any letter in this alternative. if the operand fits any letter in this alternative.
Otherwise, clear BADOP if this operand could fit some Otherwise, clear BADOP if this operand could fit some
...@@ -1828,6 +1830,13 @@ process_alt_operands (int only_alternative) ...@@ -1828,6 +1830,13 @@ process_alt_operands (int only_alternative)
early_clobber_p = true; early_clobber_p = true;
break; break;
case '$':
op_reject += LRA_MAX_REJECT;
break;
case '^':
op_reject += LRA_LOSER_COST_FACTOR;
break;
case '#': case '#':
/* Ignore rest of this alternative. */ /* Ignore rest of this alternative. */
c = '\0'; c = '\0';
...@@ -2114,6 +2123,7 @@ process_alt_operands (int only_alternative) ...@@ -2114,6 +2123,7 @@ process_alt_operands (int only_alternative)
int const_to_mem = 0; int const_to_mem = 0;
bool no_regs_p; bool no_regs_p;
reject += op_reject;
/* Never do output reload of stack pointer. It makes /* Never do output reload of stack pointer. It makes
impossible to do elimination when SP is changed in impossible to do elimination when SP is changed in
RTL. */ RTL. */
......
...@@ -307,6 +307,7 @@ parse_output_constraint (const char **constraint_p, int operand_num, ...@@ -307,6 +307,7 @@ parse_output_constraint (const char **constraint_p, int operand_num,
break; break;
case '?': case '!': case '*': case '&': case '#': case '?': case '!': case '*': case '&': case '#':
case '$': case '^':
case 'E': case 'F': case 'G': case 'H': case 'E': case 'F': case 'G': case 'H':
case 's': case 'i': case 'n': case 's': case 'i': case 'n':
case 'I': case 'J': case 'K': case 'L': case 'M': case 'I': case 'J': case 'K': case 'L': case 'M':
...@@ -397,6 +398,7 @@ parse_input_constraint (const char **constraint_p, int input_num, ...@@ -397,6 +398,7 @@ parse_input_constraint (const char **constraint_p, int input_num,
case '<': case '>': case '<': case '>':
case '?': case '!': case '*': case '#': case '?': case '!': case '*': case '#':
case '$': case '^':
case 'E': case 'F': case 'G': case 'H': case 'E': case 'F': case 'G': case 'H':
case 's': case 'i': case 'n': case 's': case 'i': case 'n':
case 'I': case 'J': case 'K': case 'L': case 'M': case 'I': case 'J': case 'K': case 'L': case 'M':
......
2015-01-15 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/64110
* gcc.target/i386/pr64110.c: Add scan-assembler.
2015-01-15 Thomas Schwinge <thomas@codesourcery.com> 2015-01-15 Thomas Schwinge <thomas@codesourcery.com>
James Norris <jnorris@codesourcery.com> James Norris <jnorris@codesourcery.com>
Cesar Philippidis <cesar@codesourcery.com> Cesar Philippidis <cesar@codesourcery.com>
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O3 -march=core-avx2" } */ /* { dg-options "-O3 -march=core-avx2" } */
/* { dg-final { scan-assembler "vmovd\[\\t \]" } } */
int foo (void); int foo (void);
int a; int a;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment