From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20940 invoked by alias); 16 Sep 2007 11:49:14 -0000 Received: (qmail 20920 invoked by uid 48); 16 Sep 2007 11:49:05 -0000 Date: Sun, 16 Sep 2007 11:49:00 -0000 Subject: [Bug tree-optimization/33447] New: Non-empty latch block prevents loop vectorization X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "irar at il dot ibm dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-09/txt/msg01288.txt.bz2 The following loop (from linpk.f90) contains a non-empty latch block before tree optimizations: Source code: Line m = MOD(N,4) 323 IF ( m.NE.0 ) THEN 324 DO i = 1 , m 325 Dy(i) = Dy(i) + Da*Dx(i) 326 ENDDO 327 IF ( N.LT.4 ) RETURN 328 ENDIF 329 mp1 = m + 1 330 DO i = mp1 , N , 4 331 Dy(i) = Dy(i) + Da*Dx(i) 332 Dy(i+1) = Dy(i+1) + Da*Dx(i+1) 333 Dy(i+2) = Dy(i+2) + Da*Dx(i+2) 334 Dy(i+3) = Dy(i+3) + Da*Dx(i+3) 335 ENDDO The first SSA dump: : ... if (countm1.32_8 == 0) goto ; else goto ; : countm1.32_98 = countm1.32_8 + 4294967295; goto ; This is also related to PR 28643 and PR 33244. However, in these PRs some tree optimization puts stmts/phi nodes in the latch block, while in the lnpck example the latch block is non-empty to begin with. -- Summary: Non-empty latch block prevents loop vectorization Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: irar at il dot ibm dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33447