From patchwork Tue Dec 8 07:13:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 553816 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BE1C01402A9 for ; Tue, 8 Dec 2015 18:14:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=IKVr3hFR; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=UbYc+SWl24tbQbh1ySAifRZNse3mHCZlG/czXnHRFuXFOU2Hg0zTh ejEnDDWIZkEBkuItuJS1vbti6JFU0rmLm42DuTw45pVrrcqGqDmRuP6M8Oi8PUed lqclQawLEZmHCtlLz6vREouBvLo211eOXIfD/r0Q0FiCWMjX2WwePI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=PVEaAp/0H6SyTrgu/dblQeT+JPE=; b=IKVr3hFR7S9OJ/6LPwUS +19xmzmp5H/gIuMOG7nSQYVaw3lCyM1b4a8uOTph7rHKjYuApm0rXuvdggNLxVOB QUyX0L8kpSO66lVX96ca8NgxoTfaoA2cpFwfAzhWV/c2k65brmPtk76pePb/4kGS snGLuP1vwrS3ZlmqPjT8EBg= Received: (qmail 70706 invoked by alias); 8 Dec 2015 07:14:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 70685 invoked by uid 89); 8 Dec 2015 07:14:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qk0-f180.google.com Received: from mail-qk0-f180.google.com (HELO mail-qk0-f180.google.com) (209.85.220.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 08 Dec 2015 07:14:29 +0000 Received: by qkdb5 with SMTP id b5so17203514qkd.0 for ; Mon, 07 Dec 2015 23:14:27 -0800 (PST) X-Received: by 10.55.195.216 with SMTP id r85mr2705062qkl.4.1449558867161; Mon, 07 Dec 2015 23:14:27 -0800 (PST) Received: from msticlxl57.ims.intel.com (irdmzpr01-ext.ir.intel.com. [192.198.151.36]) by smtp.gmail.com with ESMTPSA id p17sm934342qhb.34.2015.12.07.23.14.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Dec 2015 23:14:26 -0800 (PST) Date: Tue, 8 Dec 2015 10:13:49 +0300 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, PR tree-optimization/68766] Remove all LOOP_VECTORIZED calls Message-ID: <20151208071349.GA12548@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi, This patch enables LOOP_VECTORIZED calls processing when debug counters are used for vectorizer. Bootstrapped and regtested on x86_64-unknown-linux-gnu. Patch was approved in tracker [1] and applied to trunk. Thanks, Ilya [1] - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68766#c3 --- gcc/ 2015-12-08 Ilya Enkovich PR tree-optimization/68766 * tree-vectorizer.c (vectorize_loops): Check for if-converted loops when debug counters are used. gcc/testsuite/ 2015-12-08 Ilya Enkovich PR tree-optimization/68766 * gcc.dg/pr68766.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr68766.c b/gcc/testsuite/gcc.dg/pr68766.c new file mode 100644 index 0000000..a0d549b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr68766.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-vectorize -fdbg-cnt=vect_loop:1" } */ +/* { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } } */ +/* { dg-prune-output "dbg_cnt 'vect_loop' set to 1" } */ + +int a, b, g, h; +int c[58]; +int d[58]; +int fn1() { + for (; g; g++) + if (a) + c[g] = b; +} + +int fn2() { + fn1(); + for (; h; h++) + d[h] = 0; +} diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index b721c56..c496c4b 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -536,7 +536,13 @@ vectorize_loops (void) continue; if (!dbg_cnt (vect_loop)) - break; + { + /* We may miss some if-converted loops due to + debug counter. Set any_ifcvt_loops to visit + them at finalization. */ + any_ifcvt_loops = true; + break; + } gimple *loop_vectorized_call = vect_loop_vectorized_call (loop); if (loop_vectorized_call)