From patchwork Sun Dec 10 19:56:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Andrew Pinski (QUIC)" X-Patchwork-Id: 17807 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6673540vqy; Sun, 10 Dec 2023 11:57:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/GD7cvRygDkQGKHV5jqnhxFMfmvBbhSSaDQXnNeTk3beBEb7njOkTuvf4NJPLOxbXmgfl X-Received: by 2002:ac8:5909:0:b0:425:4043:96f8 with SMTP id 9-20020ac85909000000b00425404396f8mr5491644qty.133.1702238252133; Sun, 10 Dec 2023 11:57:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702238252; cv=pass; d=google.com; s=arc-20160816; b=gTX/8DBhPj9VNs38wrfokEChiQSjJv/l1NPRkExWfTxQnIOX4HuRjFh/8cu9mkorBs 23BRhPmOUaDzs62ZLHkvkNWZrcZePB0eImgYxDHq12ndDky7BLy8rM4Hg5HJHxvx0anc 3rqPvwXBy2A9bbUA0I0UTe9qm8a6UgHbj1XZKxyajosiOUEj3d4ifAXlYaF5fJfssBCO WyB8tT3HQ1bi2SBU9g12MYiCuUSHgkwN2J30LZ7kWOIyK1ey2M1iwutXF7b+EtVEaRUS mhObxwxUEuWSyKReIJWloVI+6j2cRjy5WE1NeiyaJbrozTKXqm80q3gPj0d99yLz0Wyx uCaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=b3ie8txB63PiEODAJ80UdLLGaBTQ+EXz6x9NNhYq4hc=; fh=gk9A5O7Gbglvz1MjrRQ4hZ2i3c68kYkpOZJg1emXh+g=; b=WehloujPNXt1i2pGE1N909vonxSNkIcFFyt4moGUUTkpxS3NQctq3Cu1kcHkyxv6Yq uH63Nx7mSZhF1y1WynO8u7qzyrczz0n8kKK7vZfeU6Eb474N4DXgUItlc8XTe1GmgzQs AyQYVqbqPfda4QUEAJMz8O8FAI7a9hDfQURKp0gq0Y9X6JoQdh7ypot81Wrs8ppuvLEj DCEcvezJvMEMhU914Tz6NI57qsEGd5udCq7azm4np2Ezdb2kbwo5g/2lHO/4N7KPeQtZ S8xEAK5zIeuUcH7ooeWVB+bjCeGNckzzESaxQ5Hr2A9vkqTwYzl/gA2sybACP6kZIgLo PCgA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BLdEG60s; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id bx15-20020a05622a090f00b004255308a469si6876295qtb.800.2023.12.10.11.57.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 11:57:32 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BLdEG60s; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 30F963857356 for ; Sun, 10 Dec 2023 19:57:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by sourceware.org (Postfix) with ESMTPS id 10001385842B for ; Sun, 10 Dec 2023 19:57:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10001385842B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=quicinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 10001385842B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702238224; cv=none; b=NSiDiIuN9gI16qMB7IdrKxwWod1do70Uv8nW5WTpuBbMBw9kfWe9LiNsY1bJxNsFa5VL39Z/N6fYoRIFExQK+LC4einN/BeCKQhvS7A7mZdolRhtTKI80Ateo7AYR+SMqwAuszMHrZYtJ7kusIEnnf8SsWOIn830ZIodxyG7HiY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702238224; c=relaxed/simple; bh=gSML3TA75XxXHoBaWlVAnxrgADSGtZPZeXFGO0XKMZA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dMGf1PybNWPKUKAmWWS223RS2RVQ6ARAJzH+QYIKKUNyw1CIe2Fxj7HS8n7sazN15cDWmDyo1DWLF/1eOmHLyNvFztIiOVA3fSkfDUeeJeD/xKlvfa7qI+VGong7gCDHS8NtfRyguMLJjNzqkq4T2KKiic60k8lFAG04PyIZEZ8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BAJsP6a024168 for ; Sun, 10 Dec 2023 19:57:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=qcppdkim1; bh=b3ie8tx B63PiEODAJ80UdLLGaBTQ+EXz6x9NNhYq4hc=; b=BLdEG60sn+hod1i5ZJH90II CjJpztPavmZqtSZKd2KOUuieEE7CoJcM19UiqlF9ECgO/E5xVm7zwlbrkahxJG6M LRbwsv4NHddweFwtRHFd+VbRP1wLmt8jX2bENL53MzgYggTLpAn1jRpHG3uE7WWc WAYD1IzsDWN5KCI6ohBsCYB7eFVMtUkvsRvm7xhdocpmixRiFDoV0VTTyCNIBjWD 7UbxPTZnbMSL65yceplyYZkBem8PhudgND0oqwOW9lyH7hNjbfCycI5vR996kqge iY0wdo+NmcHB/pALE5HhdCksvRrm1NKK7Xw+Q7eF6K1ZF0kbMGYgUkEeUO5WoQQ= = Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uvp309nya-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 10 Dec 2023 19:57:01 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BAJv0vT013502 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 10 Dec 2023 19:57:00 GMT Received: from hu-apinski-lv.qualcomm.com (10.49.16.6) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sun, 10 Dec 2023 11:57:00 -0800 From: Andrew Pinski To: Subject: [PATCHv2 0/2] Fix PR 111972: Missed vectorization due to phiopt changes Date: Sun, 10 Dec 2023 11:56:48 -0800 Message-ID: <20231210195650.1772459-1-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: v2jSQf6G_1Xt723HCW6a76n5puaI-hI0 X-Proofpoint-GUID: v2jSQf6G_1Xt723HCW6a76n5puaI-hI0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 phishscore=0 mlxlogscore=273 lowpriorityscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 adultscore=0 spamscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312100175 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784926177400222943 X-GMAIL-MSGID: 1784926177400222943 This patch set fixes PR 111972 and the fallout from it. The first patch is a fix for -fanalyzer which I had implemented with a different version of the 2nd patch while I was working at Marvell. And the 2nd patch fixes the issue by having the following as canonical forms: * `a ^ 1` is the canonical form of `(convert_back)(zero_one == 0)` (and `(convert_back)(zero_one != 1)`). * `(convert)a` is the canonical form of `(convert)(zero_one != 0)` (and `(convert)(zero_one == 1)`). Andrew Pinski (2): Remove check of unsigned_char in maybe_undo_optimize_bit_field_compare. MATCH: (convert)(zero_one !=/== 0/1) for outer type and zero_one type are the same gcc/analyzer/region-model-manager.cc | 3 -- gcc/fold-const.cc | 27 ----------------- gcc/match.pd | 16 ++++++++++ gcc/testsuite/gcc.dg/fold-even-1.c | 32 -------------------- gcc/testsuite/gcc.dg/tree-ssa/pr110637-1.c | 10 +++++++ gcc/testsuite/gcc.dg/tree-ssa/pr110637-2.c | 13 +++++++++ gcc/testsuite/gcc.dg/tree-ssa/pr110637-3.c | 14 +++++++++ gcc/testsuite/gcc.dg/tree-ssa/pr111972-1.c | 34 ++++++++++++++++++++++ gcc/testsuite/gcc.dg/tree-ssa/pr69270.c | 4 +-- gcc/testsuite/gcc.target/i386/pr110790-2.c | 16 ++++++++-- 10 files changed, 103 insertions(+), 66 deletions(-) delete mode 100644 gcc/testsuite/gcc.dg/fold-even-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr110637-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr110637-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr110637-3.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr111972-1.c