Commit Graph

259 Commits

Author SHA1 Message Date
J"orn Rennecke
a1c0cf1f76 loop.c (strength_reduce): When doing biv->giv conversion, update reg note of NEXT->insn.
* loop.c (strength_reduce): When doing biv->giv conversion, update
	reg note of NEXT->insn.

From-SVN: r27574
1999-06-17 14:35:59 +01:00
Jeffrey A Law
51f0646f8a loop.c (move_movables): Note issues with replacing REGs with SUBREGs.
�
        * loop.c (move_movables): Note issues with replacing REGs with
        SUBREGs.
        * mips.h (GO_IF_LEGITIMATE_ADDRESS): Handle SUBREGs properly.

From-SVN: r27573
1999-06-17 07:29:11 -06:00
J"orn Rennecke
41c1b007f1 loop.c (strength_reduce): When doing biv->giv conversion, fix up reg_biv_class.
* loop.c (strength_reduce): When doing biv->giv conversion, fix up
	reg_biv_class.
	(recombine_givs): Set ix field after sorting.

From-SVN: r27565
1999-06-17 10:32:59 +01:00
J"orn Rennecke
1b786838b1 loop.c (strength_reduce): Insert sets of derived givs at every biv increment, even if it's the only one.
* loop.c (strength_reduce): Insert sets of derived givs at every
	biv increment, even if it's the only one.

From-SVN: r27549
1999-06-16 12:46:14 +01:00
J"orn Rennecke
7c2772f105 loop.c (loop_insn_first_p): Don't compare LUIDs when P is a note...
* loop.c (loop_insn_first_p): Don't compare LUIDs when P
	is a note; use <= for the compare; advance P while it is
	a NOTE.

From-SVN: r27454
1999-06-09 15:09:50 +01:00
Andreas Schwab
ef1d4aec0e loop.c (check_dbra_loop): Fix change of Jan 19.
1999-06-04  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
        * loop.c (check_dbra_loop): Fix change of Jan 19.

From-SVN: r27345
1999-06-03 19:32:21 -06:00
J"orn Rennecke
2485126f2d * loop.c (strength_reduce): Don't do biv->giv conversion on constants.
From-SVN: r27194
1999-05-26 19:46:21 -06:00
Jeffrey A Law
ae188a870e loop.c (strength_reduce): Do not clear NOT_EVERY_ITERATION at the last CODE_LABEL in a loop if...
* loop.c (strength_reduce): Do not clear NOT_EVERY_ITERATION at the
	last CODE_LABEL in a loop if we have previously passed a jump
	to the top of the loop.

From-SVN: r27125
1999-05-24 07:43:22 -06:00
Jeff Law
a366a40a7e [multiple changes]
Sun May 23 20:31:16 1999  Jeffrey A Law  (law@cygnus.com)
        * loop.c (strength_reduce): Grow reg_single_usage as needed.
Sun May 23 10:13:20 1999  David O'Brien <obrien@FreeBSD.org>
        * i386/freebsd-elf.h (LINK_SPEC): Change -static to -Bstatic.
        Also remove a useless comment.
Sun May 23 10:05:23 1999  Jerry Quinn <jquinn@nortelnetworks.com>
        * pa.md (negdf2,negsf2):  Use fneg instead of fsub on pa 2.0.

From-SVN: r27111
1999-05-23 13:37:42 -06:00
Graham Stott
ab5193833c loop.c (maybe_eliminate_biv): Check regno against max_reg_before_loop.
* loop.c (maybe_eliminate_biv): Check regno against
        max_reg_before_loop.

From-SVN: r26918
1999-05-12 18:57:05 -06:00
Jeffrey A Law
d4ca58b3e0 * loop.c (strength_reduce): Re-enable Joern's loop improvements.
From-SVN: r26299
1999-04-08 12:21:29 -06:00
J"orn Rennecke
fdb1833aca loop.c (maybe_eliminate_biv): For libcalls that set a giv, skip to end of libcall.
* loop.c (maybe_eliminate_biv): For libcalls that set a giv, skip to
	end of libcall.

From-SVN: r26056
1999-03-29 12:56:45 +01:00
J"orn Rennecke
0466bdc4c8 loop.c (combine_givs): Fix index into can_combine when doing benefit adjustment for remaining givs when...
* loop.c (combine_givs): Fix index into can_combine when doing
	benefit adjustment for remaining givs when having combined a giv.

From-SVN: r25998
1999-03-26 11:46:59 +00:00
Finn Hakansson
cc29143343 * loop.c (strength_reduce): Correct a comment.
From-SVN: r25983
1999-03-25 09:31:16 -07:00
Michael Hayes
b50cb11f46 * loop.c (check_dbra_loop): Fix debug message.
From-SVN: r25868
1999-03-20 02:35:35 +00:00
Kaveh R. Ghazi
8db99db275 Warning fixes:
* cccp.c (create_definition): Cast to U_CHAR* when assigning to one.
        * cppfiles.c (read_and_prescan): Likewise.
        Start a #define in column 0.
        * cpplib.c (cpp_define): Cast to U_CHAR* when assigning to one.
        (cpp_push_buffer): Likewise for cpp_buffer*.
        (do_include): Change the type of `fbeg' and `fend' to unsigned char*.
        (do_endif): Cast to char* when assigning to one.
        (do_assert): Likewise.
        (do_unassert): Likewise.
        (cpp_read_check_assertion): Change the type of `name' to U_CHAR*.
        Don't do unnecessary cast to char* anymore.
        * genrecog.c (make_insn_sequence): Cast to char** when assigning
        to one.  Cast the first argument of bzero to PTR.
        * loop.c (strength_reduce): Remove unused variable `note'.
        * reload1.c (new_insn_chain): Cast to struct insn_chain* when
        assigning to one.
        * rtl.c (copy_rtx): Use memcpy instead of bcopy.

From-SVN: r25860
1999-03-19 12:43:55 +00:00
Nick Clifton
6449b397c2 Do not perform pseudo replacements if the loop contains volatile memory
references.

From-SVN: r25841
1999-03-18 15:59:50 +00:00
J"orn Rennecke
8e9fb571ee loop.c (strength_reduce): Don't do biv increment -> DEST_REG giv conversion if we don't know the lifetime.
* loop.c (strength_reduce): Don't do biv increment -> DEST_REG giv
	conversion if we don't know the lifetime.

From-SVN: r25702
1999-03-11 13:28:55 +00:00
J"orn Rennecke
f38cbf0fd3 rtl.h (insn_first_p): Don't declare.
* rtl.h (insn_first_p): Don't declare.
	* rtlanal.c (insn_first_p): Delete.
	* loop.c (loop_insn_first_p): Faster implementation.

From-SVN: r25436
1999-02-25 11:16:17 +00:00
J"orn Rennecke
c99f8c2a3e loop.h (loop_insn_first_p): Declare.
* loop.h (loop_insn_first_p): Declare.
	* loop.c (loop_insn_first_p): No longer static.
	* unroll.c (iteration_info) Fix comparison to
	reg_iv_type->num_elements.
	Before accessing reg_biv_class, check index against
	max_reg_before_loop.
	Fix and enable code for giv iterators.
	(loop_iterations): Compare with reg_iv_type->num_elements instead
	of with max_reg_before_loop.

From-SVN: r25401
1999-02-24 11:50:54 +00:00
Andrew MacLeod
89d3d44249 loop.c (libcall_other_regs): Make extern.
* loop.c (libcall_other_regs): Make extern.
	* rtl.h (find_last_value): Add parameter to prototype.
	(libcall_other_reg): Add extern declaration.
	* rtlanal.c (find_last_value): Add another parameter to allow
	a definition using a hardware register to be found as well.

From-SVN: r25378
1999-02-22 14:11:58 +00:00
J"orn Rennecke
1cb1fe6699 rtlanal.c (insn_first_p): Fix return value for insn == reference.
* rtlanal.c (insn_first_p): Fix return value for insn == reference.
	* loop.c (strength_reduce, check_final_value, check_dbra_loop):
	Use loop_insn_first_p.

From-SVN: r25321
1999-02-19 14:49:59 +00:00
J"orn Rennecke
b72bdd8496 loop.c (strength_reduce): Check for intervening jumps when converting biv increment to giv.
* loop.c (strength_reduce): Check for intervening jumps when
	converting biv increment to giv.

From-SVN: r25310
1999-02-19 11:59:01 +00:00
J"orn Rennecke
743f9f5dfd loop.c (strength_reduce): For derived givs, replace the giv this was derived from with its new_reg.
* loop.c (strength_reduce): For derived givs, replace the
	giv this was derived from with its new_reg.
	(recombine_givs): Don't set new_reg for derived giv.
	And don't print it, print SUM instead.

From-SVN: r25289
1999-02-18 17:47:53 +00:00
J"orn Rennecke
079a615d28 loop.c (strength_reduce): Don't move giv insn for biv turned giv below scan_start.
* loop.c (strength_reduce): Don't move giv insn for biv turned giv
	below scan_start.

From-SVN: r25264
1999-02-17 09:01:07 +00:00
J"orn Rennecke
8c354a412f loop.c (strength_reduce): Calculate maybe_dead before calling recombine_givs.
* loop.c (strength_reduce): Calculate maybe_dead before
	calling recombine_givs.

From-SVN: r25251
1999-02-16 17:34:35 +00:00
J"orn Rennecke
1ccf893726 * loop.c (strength_reduce): Dump biv increment -> giv conversions.
From-SVN: r25250
1999-02-16 16:47:29 +00:00
Jeff Law
c4ae272555 loop.c (mark_loop_jump): Handle LO_SUM.
�
        * loop.c (mark_loop_jump): Handle LO_SUM.  If we encounter something
        we do not understand, mark the loop and containing loops as invalid.

From-SVN: r25215
1999-02-15 03:37:22 -07:00
Jeffrey A Law
9f4ec51572 loop.c: Disable recent loop changes.
* loop.c: Disable recent loop changes.  Temporary as Joern
        continues to fix problems.

From-SVN: r25184
1999-02-13 16:47:23 -07:00
Richard Henderson
ba12c883e6 loop.c (combine_givs_used_by_other): Delete.
* loop.c (combine_givs_used_by_other): Delete.
        (combine_givs_benefit_from): Delete.
        (combine_givs): Deny combination of givs only used once.  Simplify
        code with the death of combine_givs_benefit_from.

From-SVN: r25183
1999-02-13 15:25:19 -08:00
Michael Hayes
77854601c2 loop.c (scan_loop): Call reg_in_basic_block_p before loop_reg_used_before_p.
* loop.c (scan_loop): Call reg_in_basic_block_p before
	loop_reg_used_before_p.

From-SVN: r25182
1999-02-13 14:25:58 +00:00
J"orn Rennecke
a6207a2b7e loop.c (loop_insn_first_p, [...]): New functions.
* loop.c (loop_insn_first_p, biv_elimination_giv_has_0_offset):
	New functions.
	(maybe_eliminate_biv_1): Use biv_elimination_giv_has_0_offset.

From-SVN: r25167
1999-02-12 10:33:17 +00:00
J"orn Rennecke
826947c572 loop.c (load_mems): Don't guess how to do a load / store, use emit_move_insn.
* loop.c (load_mems): Don't guess how to do a load / store, use
	emit_move_insn.

From-SVN: r25165
1999-02-12 08:57:56 +00:00
Richard Henderson
d6b4453299 loop.c (reg_single_usage): New file-scope variable ...
* loop.c (reg_single_usage): New file-scope variable ...
        (scan_loop): ... moved out of here.  Always initialize.
        Test loop_has_call instead of reg_single_usage not zero.
        Free reg_single_usage after strength reduction.
        (count_loop_regs_set): Assume single_usage non-zero.
        (combine_givs_used_by_other): Test reg_single_usage.
        (load_mems_and_recount_loop_regs_set): Remove reg_single_usage
        as a parameter.  Assume non-zero.

From-SVN: r25098
1999-02-08 13:34:25 -08:00
Michael Meissner
3603fb785f loop.c (check_dbra_loop): A store using an address giv for which we have no life information is not...
* loop.c (check_dbra_loop): A store using an address giv for which
        we have no life information is not reversible.

From-SVN: r25051
1999-02-05 17:46:54 -07:00
Jeffrey A Law
5f3db57e52 loop.c (strength_reduce): Clear not_every_iteration when passing the NOTE_INSN_LOOP_CONT note.
* loop.c (strength_reduce): Clear not_every_iteration when
        passing the NOTE_INSN_LOOP_CONT note.

From-SVN: r25050
1999-02-05 07:38:32 -07:00
J"orn Rennecke
2d4fde68c3 loop.c (first_loop_store_insn): New file-scope variable.
* loop.c (first_loop_store_insn): New file-scope variable.
	(prescan_loop): Set it.
	(check_dbra_loop): Check if a store depends on a register
	that is set after the store.

From-SVN: r25034
1999-02-04 23:10:46 +00:00
J"orn Rennecke
6dd49eb4d3 loop.c (scan_loop): New argument loop_cont.
* loop.c (scan_loop): New argument loop_cont.  Changed caller.
        (strength_reduce): New argument loop_cont. Changed caller.
        Before clearing not_every_iteration after a label, check if
        we are not already past LOOP_CONT.

From-SVN: r25026
1999-02-04 07:19:36 -07:00
J"orn Rennecke
4d87f7a77c loop.h (express_from): Declare.
* loop.h (express_from): Declare.
	(struct induction): Replace derived flag with derived_from pointer.
	* loop.c (strength_reduce, record_giv, recombine_givs): Likewise.
	(express_from): No longer static.
	* unroll.c (find_splittable_givs): Replace derived with derived_from.
	When processing an address giv with which another giv has been
	combined that has also been derived from a third giv, handle like
	having combined with the third giv.
	Set splittable_regs_updates appropriately for derived givs.

From-SVN: r25007
1999-02-03 12:48:48 +00:00
J"orn Rennecke
e318cec07a loop.c (loop_optimize): Fix value max_uid_for_loop is reset to after find_and_verify_loops call.
* loop.c (loop_optimize): Fix value max_uid_for_loop is reset
	to after find_and_verify_loops call.

From-SVN: r24973
1999-02-02 13:38:56 +00:00
J"orn Rennecke
7221f08022 (recombine_givs): Don't use a giv that's likely to be dead to derive others.
* (recombine_givs): Don't use a giv that's likely to be dead to
	derive others.
	* loop.c (recombine_givs): Fix test for lifetime overlaps / loop
	wrap around when deriving givs.

From-SVN: r24967
1999-02-02 11:52:00 +00:00
Richard Henderson
516e5fa65f * loop.c (recombine_givs): Dump recombination and derivation data.
From-SVN: r24948
1999-01-31 14:05:28 -08:00
Jeffrey A Law
9eab30bcdc loop.c: Disable recent loop changes.
* loop.c: Disable recent loop changes.  Temporary as Joern
        continues to fix problems.

From-SVN: r24916
1999-01-30 00:32:56 -07:00
J"orn Rennecke
97ec0ad883 * loop.c (strength_reduce): Size reg_map according to reg_iv_type.
From-SVN: r24910
1999-01-29 19:27:51 +00:00
J"orn Rennecke
5310566c09 * loop.c (recombine_givs): Don't try to derive givs that have combined.
From-SVN: r24906
1999-01-29 14:36:59 +00:00
Kaveh R. Ghazi
96df87b8f6 toplev.c (notice, fnotice): Check ANSI_PROTOTYPES...
* toplev.c (notice, fnotice): Check ANSI_PROTOTYPES, not __STDC__,
        when declaring arguments and calling va_arg() to initialize them.
        * collect2.c (notice): Likewise.
        * loop.c (find_life_end): Use PROTO() macro in the prototype.

From-SVN: r24905
1999-01-29 12:10:52 +00:00
J"orn Rennecke
22b4cc6595 loop.c (strength_reduce): Fix HAVE_cc0 handling when scanning forward from cont dominator.
* loop.c (strength_reduce): Fix HAVE_cc0 handling when scanning
	forward from cont dominator.

From-SVN: r24903
1999-01-29 07:46:16 +00:00
J"orn Rennecke
f56246bec4 loop.c (strength_reduce): Grow set_in_loop / n_times_set / may_not_optimize to proper size when...
* loop.c (strength_reduce): Grow set_in_loop / n_times_set /
	may_not_optimize to proper size when converting biv increments
	into givs.
	If necessary, reallocate reg_iv_type / reg_iv_info before calling
	recombine_givs.

From-SVN: r24898
1999-01-28 16:19:58 +00:00
J"orn Rennecke
53dc05e435 loop.c (recombine_givs): New parameter unroll_p.
* loop.c (recombine_givs): New parameter unroll_p.  If set, don't
	generate complex adds.  Changed caller.
	Don't generate adds that cost more than the original one.
	(strength_reduce): Warning fixes.

From-SVN: r24895
1999-01-28 15:28:14 +00:00
J"orn Rennecke
3ec2b59097 rtl.h (insn_first_p): Declare.
* rtl.h (insn_first_p): Declare.
	* rtlanal.c (insn_first_p): New function.
	* loop.h (varray.h): Include.
	(struct induction): Change combined_with to unsigned.
	New members derived, ix and last_use.
	(reg_iv_type, reg_iv_info): Now varray_type.  All references changed.
	(REG_IV_TYPE, REG_IV_INFO): Define.
	(first_increment_giv, last_increment_giv): Declare.
	* loop.c (loop_number_loop_cont): New static variable.
	(loop_number_cont_dominator): Likewise.
	(reg_iv_type, reg_iv_info): Now varray_type.
	(first_increment_giv, last_increment_giv): New variables.
	(compute_luids, verify_dominator, find_life_end): New functions.
	(cmp_recombine_givs_stats, recombine_givs): Likewise.
	(loop_optimize): Allocate loop_number_loop_cont and
	loop_number_cont_dominator.  Use compute_luids.
	(find_and_verify_loops): Initialize loop_number_loop_cont and
	loop_number_cont_dominator.
	(strength_reduce): Try to find bivs that can be expressed as givs
	of another biv, and to convert biv increments into givs.
	Call recombine_givs.  Handle derived givs.
	(record_biv): New argument location.  All callers changed.
	(record_giv): Initialize derived and last_use fields.
	(basic_induction_var): New argument location.  All callers changed.
	(combine_givs): Don't combine a DEST_REG giv with a DEST_ADDR giv.
	Increment combined_with instead of setting to 1.
	* unroll.c (derived_regs): New static variable.
	(unroll_loop): Initialize it.
	Allocate local_regno according to max_reg_num.
	(copy_loop_body): Cope with derived givs.
	(find_splittable_givs): Check for Givs made from biv increments.
	Set derived_regs for givs.
	* Makefile.in (stmt.o, loop.o, unroll.o): Depend on loop.h .

From-SVN: r24889
1999-01-27 15:45:50 +00:00