From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2885 invoked by alias); 13 Nov 2015 13:17:57 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 2871 invoked by uid 89); 13 Nov 2015 13:17:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f180.google.com Received: from mail-ig0-f180.google.com (HELO mail-ig0-f180.google.com) (209.85.213.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 13 Nov 2015 13:17:55 +0000 Received: by igbhv6 with SMTP id hv6so14004981igb.0 for ; Fri, 13 Nov 2015 05:17:53 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.50.88.105 with SMTP id bf9mr3255319igb.39.1447420673231; Fri, 13 Nov 2015 05:17:53 -0800 (PST) Received: by 10.36.209.7 with HTTP; Fri, 13 Nov 2015 05:17:53 -0800 (PST) In-Reply-To: References: <20151112160843.GG51435@msticlxl57.ims.intel.com> Date: Fri, 13 Nov 2015 13:17:00 -0000 Message-ID: Subject: Re: [PATCH] Avoid false vector mask conversion From: Ilya Enkovich To: Richard Biener Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg01693.txt.bz2 2015-11-13 13:03 GMT+03:00 Richard Biener : > On Thu, Nov 12, 2015 at 5:08 PM, Ilya Enkovich wrote: >> Hi, >> >> When we use LTO for fortran we may have a mix 32bit and 1bit scalar booleans. It means we may have conversion of one scalar type to another which confuses vectorizer because values with different scalar boolean type may get the same vectype. > > Confuses aka fails to vectorize? Right. > >> This patch transforms such conversions into comparison. >> >> I managed to make a small fortran test which gets vectorized with this patch but I didn't find how I can run fortran test with LTO and then scan tree dump to check it is vectorized. BTW here is a loop from the test: >> >> real*8 a(18) >> logical b(18) >> integer i >> >> do i=1,18 >> if(a(i).gt.0.d0) then >> b(i)=.true. >> else >> b(i)=.false. >> endif >> enddo > > This looks the the "error" comes from if-conversion - can't we do > better there then? No, this loop is transformed into a single BB before if-conversion by cselim + phiopt. Ilya > > Richard. > >> Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk? >> >> Thanks, >> Ilya