From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100952 invoked by alias); 23 Nov 2015 13:05:12 -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 100926 invoked by uid 89); 23 Nov 2015 13:05:11 -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-io0-f172.google.com Received: from mail-io0-f172.google.com (HELO mail-io0-f172.google.com) (209.85.223.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 23 Nov 2015 13:05:10 +0000 Received: by iofh3 with SMTP id h3so186131142iof.3 for ; Mon, 23 Nov 2015 05:05:08 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.107.36.208 with SMTP id k199mr30017522iok.147.1448283908619; Mon, 23 Nov 2015 05:05:08 -0800 (PST) Received: by 10.36.209.7 with HTTP; Mon, 23 Nov 2015 05:05:08 -0800 (PST) In-Reply-To: References: <20151112160843.GG51435@msticlxl57.ims.intel.com> Date: Mon, 23 Nov 2015 13:15: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/msg02706.txt.bz2 Ping 2015-11-13 16:17 GMT+03:00 Ilya Enkovich : > 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