aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-doloop.c
diff options
context:
space:
mode:
authorAdrian Straetling <straetling@de.ibm.com>2005-05-25 11:52:13 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2005-05-25 11:52:13 +0000
commita71a498df01ba32349bed4e72631433be1ff4a2a (patch)
treef896023adb7eb858c67b994bbe4eac93db8874ba /gcc/loop-doloop.c
parentbe62afb4d55d42c776c13a70800f3d0300f9bb6a (diff)
downloadgcc-a71a498df01ba32349bed4e72631433be1ff4a2a.zip
gcc-a71a498df01ba32349bed4e72631433be1ff4a2a.tar.gz
gcc-a71a498df01ba32349bed4e72631433be1ff4a2a.tar.bz2
loop-doloop.c: Include "target.h".
2005-05-25 Adrian Straetling <straetling@de.ibm.com> * loop-doloop.c: Include "target.h". (doloop_valid_p): Move tests to function in targhooks.c. * target.h (struct gcc_target): New target hook "insn_valid_within_doloop". * target-def.h: Define default value for "insn_valid_within_doloop". (TARGET_INITIALIZER): Insert new target hook into initializer. * targhooks.c (default_insn_valid_within_doloop): New function. * targhooks.h (default_insn_valid_within_doloop): Declare. * hooks.c (hook_bool_rtx_true): New function. * hooks.h (hook_bool_rtx_true): Declare. * doc/tm.texi: Add documentation for new target hook. From-SVN: r100143
Diffstat (limited to 'gcc/loop-doloop.c')
-rw-r--r--gcc/loop-doloop.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/gcc/loop-doloop.c b/gcc/loop-doloop.c
index c6ef37e..4a2bb87 100644
--- a/gcc/loop-doloop.c
+++ b/gcc/loop-doloop.c
@@ -33,6 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "cfgloop.h"
#include "output.h"
#include "params.h"
+#include "target.h"
/* This module is used to modify loops with a determinable number of
iterations to use special low-overhead looping instructions.
@@ -187,27 +188,14 @@ doloop_valid_p (struct loop *loop, struct niter_desc *desc)
insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
{
- /* A called function may clobber any special registers required for
- low-overhead looping. */
- if (CALL_P (insn))
- {
- if (dump_file)
- fprintf (dump_file, "Doloop: Function call in loop.\n");
+ /* Different targets have different necessities for low-overhead
+ looping. Call the back end for each instruction within the loop
+ to let it decide whether the insn is valid. */
+ if (!targetm.insn_valid_within_doloop (insn))
+ {
result = false;
goto cleanup;
- }
-
- /* Some targets (eg, PPC) use the count register for branch on table
- instructions. ??? This should be a target specific check. */
- if (JUMP_P (insn)
- && (GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
- || GET_CODE (PATTERN (insn)) == ADDR_VEC))
- {
- if (dump_file)
- fprintf (dump_file, "Doloop: Computed branch in the loop.\n");
- result = false;
- goto cleanup;
- }
+ }
}
}
result = true;