From patchwork Fri Jun 22 09:12:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 139590 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp634627lji; Fri, 22 Jun 2018 02:14:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJKRZiUM8eqtO4KBYR5BRHRDXvpamwuUkMfplSIaWnHN6jS2P2fz5R48pfn8U492vVrdkl/ X-Received: by 2002:a65:6657:: with SMTP id z23-v6mr682671pgv.257.1529658841583; Fri, 22 Jun 2018 02:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529658841; cv=none; d=google.com; s=arc-20160816; b=p+VTJTVK7Bm1BiBdy+1dOPSz2xop4FR3aqVKo57EK72wN26LbDmqiFEAZtV740ZjSy ahbTkuia31ac0j4JVdSyZQXghs5HE5+vRwMTYYoN3H8BW5yxZeBns1Dj+iDc2E2TkAxr JMfD8EWruqAOSud+kDQQsELxw9Cfu+NUwTMtZr+CXFxQ3utq/zsUflvr/FCGYi4b/IPu JjNA+y6XBuxQdvFGIPJPjUybQ147kx5NVPghmpIrc9y1f+nxdQbU6svTkOzZXsxzCg2A zdAi8/gLQKBMoX8hUwX9tWLAjqD6N3WYLKFMiaHVLF1bNBOWyeh3NmYEtmCqCkcC45Do Z46Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=GmdOh4DO5aSFQE5Fq9usYdF5SS2k0QJWzkoZ524J/Ao=; b=GaCBQdsi0JTjY4ive1ki6cUdFVALSQLiI+3wa8I1WqstRHzZL0T8TnZOLGhj4dVyBz 6X17lMhRX0oSbSQSBjvfBMfFEHYV8P9EOl8xyD8lsKlf3a8/o92x6UnDeHxnNu+fKUK6 75M68lFu3PvyJEz2mmY6cFc9DNsu+7DrPIb24oqV2REbpd/tCA7/bn96jBgPl7ZWAOcf vxzUBifArQkE8uwvYmB0dm2q99bZPSktTsdRkrbVpQQa2P7BRtGqS0nVNnKMf6tdABXc TlOPnvg+LWzU1dnhG6TO9/S3wzDAJucUjD6lcLGqXBk9xBS3nALu6DnwTfN5vyO40rnW Xsuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=hmoYdP2G; spf=pass (google.com: domain of gcc-patches-return-480262-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-480262-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id m89-v6si6991062pfj.192.2018.06.22.02.14.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jun 2018 02:14:01 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-480262-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=hmoYdP2G; spf=pass (google.com: domain of gcc-patches-return-480262-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-480262-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=fX5/3v62sVTeVylNi+e5Wz+iEJ2uBz0gPjdL99XhSON8de J9Kr9NQytLjpICnEGfrnjy/8Ga00arJRwENn6r3MTCvxAvJcxrv3HT71s67GOfR+ OQlNNzSMxFXBCVemZfxs1swKgHpu+mAw/UjUZyGPHedjsW/88FYLfHLFVcOTY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=N1Bif0TrLRdXpFzg42gisdVuFBo=; b=hmoYdP2GrMIWPK6+CGcA ve/UGUWlREuHa6zYH+Mn0zC8wQRuiPAZNDhgKn9BJo/BCvlze3NOKzO2M2oJ2xEJ oZajjlIEnkxACwR0Uef3gwwPrkVFgV94FtxhLTbjZ8giJVIrZ2F1Nu47LB40RJq5 1/QlGJVmftoLxjBHw6R+5vU= Received: (qmail 35349 invoked by alias); 22 Jun 2018 09:13:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 35237 invoked by uid 89); 22 Jun 2018 09:13:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:sk:v7-v6mr, Hx-languages-length:1136 X-HELO: mail-lf0-f41.google.com Received: from mail-lf0-f41.google.com (HELO mail-lf0-f41.google.com) (209.85.215.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Jun 2018 09:13:38 +0000 Received: by mail-lf0-f41.google.com with SMTP id j26-v6so191218lfb.11 for ; Fri, 22 Jun 2018 02:13:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Nj5TYtbWK4/2cUBwBfIndBZOQeyFBgEXEd5UuPhYoqc=; b=Mnf36afk9kggeHQe7TsT40qcd7vahm1iN79j1LxNaDxUzXClqC1O5FaRuNVK7HiVZ/ fBpLFDUsukFnAnKaxFmvB+NNONELbspNYwY6R8YDNYOPWOBu4D4rUzNYPmFdKzU997EO e10E0EQZvMWyqlDn0goMY4CyFQ28zYjAGDVPF/fzo5LklK+7vxnT5fdRu3BnMNEvx2lb 3cOOfV9oIHFI4GBbAiQyMYCr2p31hI/v6d99Ah+2+5XfHs/ZPMeAzN6wo3X9TmR5keWb UPF24r9VeDAuVSEUlWENAYP2RqacHbgXuk97YDFQMphqRhQ41k/ZP2NGczZ0iCn6iC3o vZZw== X-Gm-Message-State: APt69E20em92/wMfDDS7VwHwUKuSlZQddRGN2xx2sM7+P+EsCYd+IQxX N3u473MAJzWtZXx42ZiccMh+kV3ejjJaR2BZqr6Fkisr7T0= X-Received: by 2002:a2e:5047:: with SMTP id v7-v6mr697470ljd.122.1529658815889; Fri, 22 Jun 2018 02:13:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:1302:0:0:0:0:0 with HTTP; Fri, 22 Jun 2018 02:12:55 -0700 (PDT) From: Kugan Vivekanandarajah Date: Fri, 22 Jun 2018 19:12:55 +1000 Message-ID: Subject: [PATCH 1/3][POPCOUNT] Handle COND_EXPR in expression_expensive_p To: GCC Patches X-IsSubscribed: yes [PATCH 1/3][POPCOUNT] Handle COND_EXPR in expression_expensive_p gcc/ChangeLog: 2018-06-22 Kugan Vivekanandarajah * tree-scalar-evolution.c (expression_expensive_p): Handle COND_EXPR. >From aa38b98dd97567c6032c261f19b3705abc2233b0 Mon Sep 17 00:00:00 2001 From: Kugan Vivekanandarajah Date: Fri, 22 Jun 2018 14:10:26 +1000 Subject: [PATCH 1/3] generate popcount when checked for zero Change-Id: I7255bf35e28222f7418852cb232246edf1fb5a39 --- gcc/tree-scalar-evolution.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 4b0ec02..db419a4 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -3508,6 +3508,11 @@ expression_expensive_p (tree expr) return false; } + if (code == COND_EXPR) + return (expression_expensive_p (TREE_OPERAND (expr, 0)) + || expression_expensive_p (TREE_OPERAND (expr, 1)) + || expression_expensive_p (TREE_OPERAND (expr, 2))); + switch (TREE_CODE_CLASS (code)) { case tcc_binary: -- 2.7.4