Commit 06b8f7ac by Kyrylo Tkachov Committed by Kyrylo Tkachov

[ARM] Restrict MAX_CONDITIONAL_EXECUTE when -mrestrict-it is in place

	* config/arm/arm.c (arm_option_params_internal): When optimising
	for speed set max_insns_skipped when arm_restrict_it.

	* gcc.target/arm/short-it-ifcvt-1.c: New test.
	* gcc.target/arm/short-it-ifcvt-2.c: Likewise.

From-SVN: r224367
parent 41927df0
2015-06-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm.c (arm_option_params_internal): When optimising
for speed set max_insns_skipped when arm_restrict_it.
2015-06-11 Christian Bruel <christian.bruel@st.com>
PR target/52144
......
......@@ -2788,7 +2788,10 @@ arm_option_params_internal (struct gcc_options *opts)
max_insns_skipped = opts->x_arm_restrict_it ? 1 : 4;
}
else
max_insns_skipped = current_tune->max_insns_skipped;
/* When -mrestrict-it is in use tone down the if-conversion. */
max_insns_skipped
= (TARGET_THUMB2_P (opts->x_target_flags) && opts->x_arm_restrict_it)
? 1 : current_tune->max_insns_skipped;
}
/* Options after initial target override. */
......
2015-06-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/arm/short-it-ifcvt-1.c: New test.
* gcc.target/arm/short-it-ifcvt-2.c: Likewise.
2015-06-11 Christian Bruel <christian.bruel@st.com>
PR target/52144
......
/* Test that ifcvt is not being too aggressive when -mrestrict-it. */
/* { dg-do compile } */
/* { dg-options "-O2 -mrestrict-it" } */
/* { dg-require-effective-target arm_thumb2_ok } */
int
f1(int x, int y, int z)
{
if (x > 100)
{
x++;
z = -z;
}
else
{
x = -x;
y = -y;
z = 1;
}
return x + y + z;
}
/* { dg-final { scan-assembler "b(gt|le)" } } */
/* Test that ifcvt is not being too aggressive when -mrestrict-it. */
/* { dg-do compile } */
/* { dg-options "-O2 -mrestrict-it" } */
/* { dg-require-effective-target arm_thumb2_ok } */
int
f1(int x, int y, int z)
{
if (x > 100)
{
x++;
z = -z;
}
else
{
x = -x;
y = -y;
}
return x + y + z;
}
/* { dg-final { scan-assembler "b(gt|le)" } } */
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