From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27604 invoked by alias); 24 Oct 2011 16:19:55 -0000 Received: (qmail 27593 invoked by uid 22791); 24 Oct 2011 16:19:53 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_FC X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Oct 2011 16:19:37 +0000 Received: by iafi7 with SMTP id i7so8974450iaf.20 for ; Mon, 24 Oct 2011 09:19:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.115.133 with SMTP id k5mr5232768icq.16.1319473176462; Mon, 24 Oct 2011 09:19:36 -0700 (PDT) Received: by 10.42.223.65 with HTTP; Mon, 24 Oct 2011 09:19:36 -0700 (PDT) In-Reply-To: References: <7FB04A5C213E9943A72EE127DB74F0ADD15FEADD80@SJEXCHCCR02.corp.ad.broadcom.com> Date: Tue, 25 Oct 2011 03:12:00 -0000 Message-ID: Subject: Re: Why doesn't GCC generate conditional move for COND_EXPR? From: Andrew Pinski To: Richard Guenther Cc: Bingfeng Mei , "gcc@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00430.txt.bz2 On Mon, Oct 24, 2011 at 7:00 AM, Richard Guenther wrote: > On Mon, Oct 24, 2011 at 2:55 PM, Bingfeng Mei wrote: >> Hello, >> I noticed that COND_EXPR is not expanded to conditional move >> as MIN_EXPR/MAX_EXPR are (assuming movmodecc is available). >> I wonder why not? >> >> I have some loop that fails tree vectorization, but still contains >> COND_EXPR from tree ifcvt pass. In the end, the generated code >> is worse than if I don't turned -ftree-vectorize on. =C2=A0This >> is on our private port. > > Because nobody touched COND_EXPR expansion since ages. I have a patch which I will be submitting next week or so that does this expansion correctly. In fact I have a few patches which improves the generation of COND_EXPR in simple cases (in PHI-OPT). Thanks, Andrew Pinski