From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81725 invoked by alias); 30 Apr 2015 11:28:47 -0000 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 Received: (qmail 81653 invoked by uid 48); 30 Apr 2015 11:28:44 -0000 From: "alalaw01 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/35226] Induction with multiplication are not vectorized Date: Thu, 30 Apr 2015 11:28:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: alalaw01 at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc version short_desc everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg02625.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35226 alalaw01 at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2015-04-30 CC| |alalaw01 at gcc dot gnu.org Version|4.3.0 |6.0 Summary|Reduction and induction |Induction with |with multiplication are not |multiplication are not |vectorized |vectorized Ever confirmed|0 |1 --- Comment #1 from alalaw01 at gcc dot gnu.org --- Multiplication reductions are supported, certainly in gcc 4.9, I think longer. However, the following induction does not vectorize on gcc 6 development branch (x86_64, -O3, with or without -mavx or -msse2): int a[24]; int main (int argc, char **argv) { int p = 1; for (int i = 0; i < 24; i++, p*=2) a[i] *= p; } -fdump-tree-vect-details suggests the multiplication is recognized as a reduction but not as an induction: test_induc.c:7:3: note: Analyze phi: p_13 = PHI test_induc.c:7:3: note: reduction used in loop. test_induc.c:7:3: note: Unknown def-use cycle pattern. test_induc.c:7:3: note: === vect_pattern_recog === test_induc.c:7:3: note: vect_is_simple_use: operand _5 test_induc.c:7:3: note: def_stmt: _5 = a[i_14]; test_induc.c:7:3: note: type of def: 3. test_induc.c:7:3: note: vect_is_simple_use: operand p_13 test_induc.c:7:3: note: def_stmt: p_13 = PHI test_induc.c:7:3: note: Unsupported pattern. ... test_induc.c:7:3: note: def_stmt: p_13 = PHI test_induc.c:7:3: note: Unsupported pattern. test_induc.c:7:3: note: not vectorized: unsupported use in stmt. test_induc.c:7:3: note: unexpected pattern. test_induc.c:4:1: note: vectorized 0 loops in function. ... : # p_13 = PHI ... p_9 = p_13 * 2;