From 74b5fcf733823b353b331c0ca30e8b71ba98c9cf Mon Sep 17 00:00:00 2001 From: Kewen Lin Date: Tue, 18 Jun 2019 05:08:02 +0000 Subject: 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 --- gcc/targhooks.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gcc/targhooks.c') diff --git a/gcc/targhooks.c b/gcc/targhooks.c index b271116..0da885e 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. -- cgit v1.1