summaryrefslogtreecommitdiff
path: root/gcc/loop-doloop.c
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-25 11:52:13 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-25 11:52:13 +0000
commit7dfa5ce3ae065424b0d7c3ac734303d0ab9b772b (patch)
treef896023adb7eb858c67b994bbe4eac93db8874ba /gcc/loop-doloop.c
parentcef1af71cbf274c343b4945baad16a8bb545891c (diff)
downloadgcc-7dfa5ce3ae065424b0d7c3ac734303d0ab9b772b.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100143 138bc75d-0d04-0410-961f-82ee72b054a4
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 c6ef37e84d6..4a2bb8774ee 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;