From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81843 invoked by alias); 4 May 2015 13:57:51 -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 81476 invoked by uid 48); 4 May 2015 13:57:47 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/66002] paq8p benchmark 50% slower than clang on sandybridge Date: Mon, 04 May 2015 13:57: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: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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 blocked 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-05/txt/msg00232.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66002 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2015-05-04 Blocks| |53947 Ever confirmed|0 |1 --- Comment #4 from Richard Biener --- prephitmp_61 = _53 <= 65535 ? pretmp_60 : -32768; is unsigned int <= 65535 ? short int : short int; pushing the condition to a separate stmt might get us to support this "narrowing" conversion. Of course ifcvt does a pretty poor job on this as well... We do vectorize for (int i=0; i>16)+1>>1); if (wt<-32768) wt=-32768; // if (wt>32767) wt=32767; w[i]=wt; } as if (wt<-32768) wt=-32768; becomes a MAX_EXPR. Also if I change it to for (int i=0; i>16)+1>>1); if (wt<-32768) wt=-32768; else if (wt>32767) wt=32767; w[i]=wt; } we vectorize it as MIN/MAX_EXPRs. Maybe you can perform this source change manually and see what it does to performance. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947 [Bug 53947] [meta-bug] vectorizer missed-optimizations