Commit 9b6dd300 by Vladimir Yanovsky Committed by Revital Eres

Avoid SMS when the candidate loop contains INC instruction

Co-Authored-By: Revital Eres <eres@il.ibm.com>

From-SVN: r127027
parent 6d023ec5
2007-07-29 Vladimir Yanovsky <yanov@il.ibm.com>
Revital Eres <eres@il.ibm.com>
* modulo-sched.c (sms_schedule): Avoid loops which includes
auto-increment instructions.
2007-07-28 Richard Guenther <rguenther@suse.de>
PR middle-end/32920
......
......@@ -987,12 +987,16 @@ sms_schedule (void)
if ( !(count_reg = doloop_register_get (tail)))
continue;
/* Don't handle BBs with calls or barriers, or !single_set insns. */
/* Don't handle BBs with calls or barriers, or !single_set insns,
or auto-increment insns (to avoid creating invalid reg-moves
for the auto-increment insns).
??? Should handle auto-increment insns. */
for (insn = head; insn != NEXT_INSN (tail); insn = NEXT_INSN (insn))
if (CALL_P (insn)
|| BARRIER_P (insn)
|| (INSN_P (insn) && !JUMP_P (insn)
&& !single_set (insn) && GET_CODE (PATTERN (insn)) != USE))
&& !single_set (insn) && GET_CODE (PATTERN (insn)) != USE)
|| (FIND_REG_INC_NOTE (insn, NULL_RTX) != 0))
break;
if (insn != NEXT_INSN (tail))
......@@ -1003,6 +1007,8 @@ sms_schedule (void)
fprintf (dump_file, "SMS loop-with-call\n");
else if (BARRIER_P (insn))
fprintf (dump_file, "SMS loop-with-barrier\n");
else if (FIND_REG_INC_NOTE (insn, NULL_RTX) != 0)
fprintf (dump_file, "SMS reg inc\n");
else
fprintf (dump_file, "SMS loop-with-not-single-set\n");
print_rtl_single (dump_file, insn);
......
2007-07-29 Vladimir Yanovsky <yanov@il.ibm.com>
Revital Eres <eres@il.ibm.com>
* gfortran.dg/sms-1.f90: New test.
2007-07-28 Richard Guenther <rguenther@suse.de>
* gcc.c-torture/compile/pr32920.c: New testcase.
! { dg-do run }
! { dg-options "-O2 -fmodulo-sched" }
program main
integer (kind = 8) :: i, l8, u8, step8
integer (kind = 4) :: l4, step4
integer (kind = 8), parameter :: big = 10000000000_8
u8 = big * 40 + 200
l4 = 200
step8 = -big
call test ((/ (i, i = u8, l4, step8) /), u8, l4 + 0_8, step8)
contains
subroutine test (a, l, u, step)
integer (kind = 8), dimension (:), intent (in) :: a
integer (kind = 8), intent (in) :: l, u, step
integer (kind = 8) :: i
integer :: j
j = 1
do i = l, u, step
if (a (j) .ne. i) call abort
j = j + 1
end do
if (size (a, 1) .ne. j - 1) call abort
end subroutine test
end program main
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment