diff options
author | Vladimir Yanovsky <yanov@il.ibm.com> | 2007-07-28 21:51:53 +0000 |
---|---|---|
committer | Revital Eres <revitale@gcc.gnu.org> | 2007-07-28 21:51:53 +0000 |
commit | 9b6dd300181991dc03186c3534062afbf9058824 (patch) | |
tree | fbc2601e3989219775a9593d107a28e213728ed3 /gcc | |
parent | 6d023ec55bfca23f4fa692b1650e3ddeecf73cc1 (diff) | |
download | gcc-9b6dd300181991dc03186c3534062afbf9058824.zip gcc-9b6dd300181991dc03186c3534062afbf9058824.tar.gz gcc-9b6dd300181991dc03186c3534062afbf9058824.tar.bz2 |
Avoid SMS when the candidate loop contains INC instruction
Co-Authored-By: Revital Eres <eres@il.ibm.com>
From-SVN: r127027
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/modulo-sched.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/sms-1.f90 | 28 |
4 files changed, 47 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 47af554..c8468a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c index d543e6b..16cd5d8 100644 --- a/gcc/modulo-sched.c +++ b/gcc/modulo-sched.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7c4fd7d..4bf697b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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. diff --git a/gcc/testsuite/gfortran.dg/sms-1.f90 b/gcc/testsuite/gfortran.dg/sms-1.f90 new file mode 100644 index 0000000..f9bfafe --- /dev/null +++ b/gcc/testsuite/gfortran.dg/sms-1.f90 @@ -0,0 +1,28 @@ +! { 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 + + |