aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2017-09-05 17:22:51 +0000
committerWilco Dijkstra <wilco@gcc.gnu.org>2017-09-05 17:22:51 +0000
commite5fc06a3d339c7db391f199c51354f61a033b555 (patch)
tree1537c9c18f0dd49c1bc42405a1848868f550833f
parentf174328efedff73f53cad8848fe69f92e940309a (diff)
downloadgcc-e5fc06a3d339c7db391f199c51354f61a033b555.zip
gcc-e5fc06a3d339c7db391f199c51354f61a033b555.tar.gz
gcc-e5fc06a3d339c7db391f199c51354f61a033b555.tar.bz2
Improve max_insns_skipped logic
Improve the logic when setting max_insns_skipped. Limit the maximum size of IT to MAX_INSN_PER_IT_BLOCK as otherwise multiple IT instructions are needed, increasing codesize. Given 4 works well for Thumb-2, use the same limit for ARM for consistency. gcc/ * config/arm/arm.c (arm_option_params_internal): Improve setting of max_insns_skipped. From-SVN: r251720
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/arm/arm.c18
2 files changed, 10 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fa34e13..99a3a76 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-05 Wilco Dijkstra <wdijkstr@arm.com>
+
+ * config/arm/arm.c (arm_option_params_internal): Improve setting of
+ max_insns_skipped.
+
2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
PR target/59501
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 4870957..0094c0e 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -2873,20 +2873,12 @@ arm_option_params_internal (void)
targetm.max_anchor_offset = TARGET_MAX_ANCHOR_OFFSET;
}
- if (optimize_size)
- {
- /* If optimizing for size, bump the number of instructions that we
- are prepared to conditionally execute (even on a StrongARM). */
- max_insns_skipped = 6;
+ /* Increase the number of conditional instructions with -Os. */
+ max_insns_skipped = optimize_size ? 4 : current_tune->max_insns_skipped;
- /* For THUMB2, we limit the conditional sequence to one IT block. */
- if (TARGET_THUMB2)
- max_insns_skipped = arm_restrict_it ? 1 : 4;
- }
- else
- /* When -mrestrict-it is in use tone down the if-conversion. */
- max_insns_skipped = (TARGET_THUMB2 && arm_restrict_it)
- ? 1 : current_tune->max_insns_skipped;
+ /* For THUMB2, we limit the conditional sequence to one IT block. */
+ if (TARGET_THUMB2)
+ max_insns_skipped = MIN (max_insns_skipped, MAX_INSN_PER_IT_BLOCK);
}
/* True if -mflip-thumb should next add an attribute for the default