From patchwork Mon Sep 16 03:11:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 1985971 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=QdVUDJGM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X6VMB4L5lz1y1m for ; Mon, 16 Sep 2024 13:12:03 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 598BC385B510 for ; Mon, 16 Sep 2024 03:12:01 +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 311E93858D20 for ; Mon, 16 Sep 2024 03:11:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 311E93858D20 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 311E93858D20 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=1726456301; cv=none; b=ObJ79287/bjBIJBFgY+P7y+CdOoepu4wUEM6hTJ1et6hVjDv2/Nb5T/+fm2BCJOCwRn3XFp91DKD/3ceIQiJkqumRj8c7bj3WjCHAHTZfENw/64vi08J3ClEHp9UKMo+BVHlLGk0SYvA/3GTIa4LQbZ4fgEzMnPI6sd3zmaJEQc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726456301; c=relaxed/simple; bh=lRI7ABFnO6yc/E+WUnDTFZ8u69VSx7dN9SRb1gPKAkk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UtXXH7qkC1PXsxOtEkKNVTUu9/2KCiotjxuEoWXaynwNa/CckGzdNbcj1R4Qm2/M/CdDB5PYspqDzzet9O1MJk0zz7B8Xw+tFyzPmF6mKHhJiGeqjPg4TMxvfKfbwK8JRWesYGvBdNFHVxGsX9UYE7cxxT7yRugo2Jm0ysAp0So= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48FNqaeb027799 for ; Mon, 16 Sep 2024 03:11:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=S+nYV9SYgkbaTNtB1xc338 TCJJmtT5N8NU+rQ/07q7A=; b=QdVUDJGMigmhaPh1AF3OFwZbDK3zPCRkUdEezk jjq/tEz6FgY+xFVydcmy++cl3ruqPhKA6wZM27n8/OsOvdTflTMZoSFeH0IEqGiX H8rzxvsXQOOU3MWWfSfNXnqIhmWthOwDGFR6+WH58Jko0Fvuozurm/Bb/cmZ6Wre oA60iA5X1tkBhvgtpuEuUnNMX9Hdcvk4zkussaN6W6PQBcPO4Cn2zJkjt/lzznUm OaadqGCQxWfHuElE2Lz7R31t8b1/1bBYechkUgUnclA/3W0a9CsGYjBimf8g2HGN wz2x76gXiFmdknF+P3bO/4YgJOXKEotH8xl7J3bI7U1NC0kw== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4k0jpkg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 16 Sep 2024 03:11:39 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 48G3BbCO025403 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 16 Sep 2024 03:11:38 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.1544.9; Sun, 15 Sep 2024 20:11:37 -0700 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH] vect: Set pattern_stmt_p on the newly created stmt_vec_info Date: Sun, 15 Sep 2024 20:11:21 -0700 Message-ID: <20240916031121.1076276-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: nalasex01b.na.qualcomm.com (10.47.209.197) 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: o4gALtTkgLLQiO5WPAX9K7KH4Nac02Nt X-Proofpoint-GUID: o4gALtTkgLLQiO5WPAX9K7KH4Nac02Nt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 phishscore=0 spamscore=0 malwarescore=0 bulkscore=0 impostorscore=0 mlxlogscore=999 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409160020 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP 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~incoming=patchwork.ozlabs.org@gcc.gnu.org While adding simple_dce_worklist to the vectorizer, there was a regression due to the slp patterns would create a SSA name but never free it even if it never existed in the IR (this case as addsub but complex ones had the same issue). The reason why it was never freed was the stmt_vec_info was not marked as a pattern stmt, unlike the other pattern stmts that use vect_init_pattern_stmt instead of vec_info::add_pattern_stmt (which is used for SLP patterns). Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-vectorizer.cc (vec_info::add_pattern_stmt): Set pattern_stmt_p. Signed-off-by: Andrew Pinski --- gcc/tree-vectorizer.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/tree-vectorizer.cc b/gcc/tree-vectorizer.cc index 0efabcbb258..4279b6db4cf 100644 --- a/gcc/tree-vectorizer.cc +++ b/gcc/tree-vectorizer.cc @@ -535,6 +535,7 @@ stmt_vec_info vec_info::add_pattern_stmt (gimple *stmt, stmt_vec_info stmt_info) { stmt_vec_info res = new_stmt_vec_info (stmt); + res->pattern_stmt_p = true; set_vinfo_for_stmt (stmt, res, false); STMT_VINFO_RELATED_STMT (res) = stmt_info; return res;