From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115207 invoked by alias); 11 Jul 2018 05:43:28 -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 115188 invoked by uid 89); 11 Jul 2018 05:43:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=audited X-HELO: mail-oi0-f67.google.com Received: from mail-oi0-f67.google.com (HELO mail-oi0-f67.google.com) (209.85.218.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Jul 2018 05:43:26 +0000 Received: by mail-oi0-f67.google.com with SMTP id 13-v6so47083562ois.1 for ; Tue, 10 Jul 2018 22:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tRyJ3HLACkVTF9HZgASXK8BhPjr8Rt8RUrCouXNlMYI=; b=Lcbc57oUVBt12Wj7DQ6FTwfUo4vzdRGFwaD9chIMtWr1RwqT2G0//Z+tn/GG5gMxS2 S7yWbloYaNdjp3Hjuf/9SgDat/MrAYtktcqj1aqIJOsGFlJgdPmRiq1lwBChohy6HMai 9oknwEZNyoNajcJxGnAxAgfIjGihb1TEC6lejJXUhao4uiDFTzsWihZ6ngMJ2Ka8j/e0 Me+kOVGuWyRq4Ehawkn19ApKagmdcm335LNwWQPfKhXhmFVqdYPjVPH9l6emXCMEVWJU nKsd2BUinXVQp1EquPkYgaKC565F9tuA5ohxqXnsCd/3M6ozY94ydFl+kEo470wHztkp yL7A== MIME-Version: 1.0 References: In-Reply-To: From: Andrew Pinski Date: Wed, 11 Jul 2018 05:43:00 -0000 Message-ID: Subject: Re: [RFC] Fix recent popcount change is breaking To: Kugan Cc: Richard Guenther , GCC Patches , Jeff Law Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00527.txt.bz2 On Tue, Jul 10, 2018 at 6:35 PM Kugan Vivekanandarajah wrote: > > Hi Andrew, > > On 11 July 2018 at 11:19, Andrew Pinski wrote: > > On Tue, Jul 10, 2018 at 6:14 PM Kugan Vivekanandarajah > > wrote: > >> > >> On 10 July 2018 at 23:17, Richard Biener wrote: > >> > On Tue, Jul 10, 2018 at 3:06 PM Kugan Vivekanandarajah > >> > wrote: > >> >> > >> >> Hi, > >> >> > >> >> Jeff told me that the recent popcount built-in detection is causing > >> >> kernel build issues as > >> >> ERROR: "__popcountsi2" > >> >> [drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko] undefined! > >> >> > >> >> I could also reproduce this. AFIK, we should check if the libfunc is > >> >> defined while checking popcount? > >> >> > >> >> I am testing the attached RFC patch. Is this reasonable? > >> > > >> > It doesn't work that way, all targets have this libfunc in libgcc. This means > >> > the kernel has to provide it. The only thing you could do is restrict > >> > replacement of CALL_EXPRs (in SCEV cprop) to those the target > >> > natively supports. > >> > >> How about restricting it in expression_expensive_p ? Is that what you > >> wanted. Attached patch does this. > >> Bootstrap and regression testing progressing. > > > > Seems like that should go into is_inexpensive_builtin instead which > > is just tested right below. > > I hought about that. is_inexpensive_builtin is used in various other > places including some inlining decision so wasn't sure if it is the > right thing. Happy to change it if that is the right thing to do. I audited all of the users (and their users if it is used in a wrapper) and found that is_inexpensive_builtin should return false for this builtin if it is a function call in the end; there are other builtins which should be checked the similar way but I think we should not going to force you to do the similar thing for those builtins. Thanks, Andrew > > Thanks, > Kugan > > > > Thanks, > > Andrew > > > >> > >> Thanks, > >> Kugan > >> > >> > > >> > Richard. > >> > > >> >> Thanks, > >> >> Kugan > >> >> > >> >> gcc/ChangeLog: > >> >> > >> >> 2018-07-10 Kugan Vivekanandarajah > >> >> > >> >> * tree-ssa-loop-niter.c (number_of_iterations_popcount): Check > >> >> if libfunc for popcount is available.