summaryrefslogtreecommitdiff
path: root/gcc/targhooks.c
diff options
context:
space:
mode:
authorKewen Lin <linkw@gcc.gnu.org>2019-06-18 05:08:02 +0000
committerKewen Lin <linkw@gcc.gnu.org>2019-06-18 05:08:02 +0000
commit74b5fcf733823b353b331c0ca30e8b71ba98c9cf (patch)
treeb9ed33a1d95fac033d35268b37e4cf0e4bcf2ca1 /gcc/targhooks.c
parent702eb490a864239256203b7fad53e397d3e7fa54 (diff)
Add predict_doloop_p target hook
Add one target hook predict_doloop_p, it return true if we can predict it is possible to use a low-overhead loop, it can help ivopts to make some better decisions. PR middle-end/80791 * target.def (predict_doloop_p): New hook. * targhooks.h (default_predict_doloop_p): New declaration. * targhooks.c (default_predict_doloop_p): New function. * doc/tm.texi.in (TARGET_PREDICT_DOLOOP_P): New hook. * doc/tm.texi: Regenerate. * config/rs6000/rs6000.c (rs6000_predict_doloop_p): New function. (TARGET_PREDICT_DOLOOP_P): New macro. * tree-ssa-loop-ivopts.c (generic_predict_doloop_p): New function. From-SVN: r272405
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r--gcc/targhooks.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index b27111639f4..0da885ec152 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -643,6 +643,19 @@ default_has_ifunc_p (void)
return HAVE_GNU_INDIRECT_FUNCTION;
}
+/* Return true if we predict the loop LOOP will be transformed to a
+ low-overhead loop, otherwise return false.
+
+ By default, false is returned, as this hook's applicability should be
+ verified for each target. Target maintainers should re-define the hook
+ if the target can take advantage of it. */
+
+bool
+default_predict_doloop_p (struct loop *loop ATTRIBUTE_UNUSED)
+{
+ return false;
+}
+
/* NULL if INSN insn is valid within a low-overhead loop, otherwise returns
an error message.