From patchwork Tue Nov 21 18:04:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manolis Tsamis X-Patchwork-Id: 167867 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp815671vqb; Tue, 21 Nov 2023 10:05:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrj+jqBREtJl5XHepDIjPjA7Y0BVbGKGP1gn3EAXuuTB4DGDnLt/f8mfQlHQY6YhHRhawt X-Received: by 2002:a05:620a:4592:b0:77c:1fa1:529e with SMTP id bp18-20020a05620a459200b0077c1fa1529emr13375203qkb.54.1700589903345; Tue, 21 Nov 2023 10:05:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700589903; cv=pass; d=google.com; s=arc-20160816; b=jdh3NyYTiyGQ3NlQa32T78KPduiv1qXabEaITIWnxr8Us7BSGTyFOxk+F0/KTyXlRa P0OOvZhj/RoD4fqQJRqs+s5kKDUh4GFF+QnuiVqopwFqYN+SB9wS0EEaUCz427wYusbn J17kavoGrdy9f0mUXudLBFrlwar1ksLFVRia1c5bc8DcOpC58kh/yQw3d20UR9gzPNRu JF/wCuyZnX/uFUcJ10xT8ZJQuo92VhdkqkDJmFwFjLEnMCStSPjGB1Bis72YIpsZI5ha nT1+Gx47hUzWV73PDXI8Z6gbq5V3vCy5XB4JBS6vmQMfhpjN5YwiZsRVRyn22iBJE48o MB0w== 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:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=JyxvabOclD/KmNHoAI1EXnvrnNutPLxWoOQoZW9GYh0=; fh=zPKnVC8S90cRHRxWVwmaTVYvnOLIVvWVyzAF+UQhqrI=; b=cWvANJL/J/ZSZyUhpnic0ub5CVZmUCkaeljRGxxryWeAHNc79zxOa8JGd3cw+CyaKj NYJSrHKixysndGiUrRq6VOM5nWiEED9p0cy8bN7kPJ/WI0gF58GrF/3nBDfMX8AMaq51 O1byhlgRf3gXlQJAGFUVl8vdFxCkWqt6rqgzXEXWSAxvnyFOiBMqMunnSWnEMAQKOii0 cpWSU6GaZPVRbqW7USQw80JPsHxJWssljZW1S7Xl0zwVKSTbnZ25IYDGMMh1Txvy3yqr 3CqB/owfrV0qNCfLnuVUsziFYCeMGKXYfQLLNfnGBi3jlKyazU0QqLs5vvFClHJBIb2v ll4w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=b7etNZEV; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id a20-20020a05620a16d400b0076cf3531349si9360829qkn.760.2023.11.21.10.05.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 10:05:03 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=b7etNZEV; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1E07B385841A for ; Tue, 21 Nov 2023 18:05:03 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by sourceware.org (Postfix) with ESMTPS id EA3BB3858D37 for ; Tue, 21 Nov 2023 18:04:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EA3BB3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EA3BB3858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::133 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700589880; cv=none; b=ZywDcnZewScPgqNsVPO6wCJuRVq31K76nkIBOMeqvC+iMh504LrA1o7Fdv5Yl1VpBov4IN6zYAd9Ey15bgMHIoqjp2HOyqJmNO3j76tD5aFxwFqoi23i2ynHIKAuKDdL3sT6tAnr3oIgNA9qZsfQxxPU7OQRd+W4jKsS8+0Ceok= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700589880; c=relaxed/simple; bh=O0vojJSKb35LokxkbibySXfmjouJijlfYOBfO180prY=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=BNJOgAKnAFqARo5Dk+c/hRqY/S+oxmgayKYLqVgMS6dxiKxaWK/UHxGvuIoAsNZXKSqQ4fr7ZgCXjx0VQ06w7XGU8Ib5P3/6V6BXnEj3oDmGxv/XuXcCLbEthKaLkxVFfcA3ZnT2+YHuFuYv8LXxTiqjcW1r/QKgbEZ1xszrQgQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-50797cf5b69so8014781e87.2 for ; Tue, 21 Nov 2023 10:04:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1700589877; x=1701194677; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JyxvabOclD/KmNHoAI1EXnvrnNutPLxWoOQoZW9GYh0=; b=b7etNZEVCePmrppL/qx0oNPAbxOaOEy03nlQCyqbHiMl+tthXB7Oew88bzjVc/vktj dLERaXjLWjXEelxkFp38dL5gI5uNOMCYiojLutvLEgPfL6NRhA85tNa4dKUNdC1tTRsH H3LoCWYuiZunDANe3iKbJmkOxJFqgKqNXsxseVeEcl3t922uEpW2qlUThuJaiBsQYY6/ cDQuHKhIdi0gQQUdMutplYMh2vJ+2NIC5PBKw/Xu+ruyW9K3iE1Poowwpz6UplLuWlyW 4EZ8GMtHvsC9jwRe++717SbWCLNyswDUCKr0JMI6j7V6T5cCBQxorHrfTzWXnEXItNoz sqCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700589877; x=1701194677; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JyxvabOclD/KmNHoAI1EXnvrnNutPLxWoOQoZW9GYh0=; b=Hg+3IEo8b9tPT4ggiSQNfWUP5CIOOEK2DBTuQT7ydLLGxI1H9x6sRWFJeLPjND+qAl 5mWT5YABWNP12tBvFDDNzPPxl9omKU58aUdeUTJd9HoRUsXwMyfwvbd16JJ7c5RD6vlC y6Ba+N8qzuJWsoztSRyPVJI+SbygKQG7bCt7Y4E/ZK+Wz3HU6S/4Ny9ZkyyNZRzRcbm6 MBaTJeTJ3w4oinmKY67p3d2vGXByGUER3vz1BIBwxmMh89juoT4kfoa9yDVxQSlQhNpX DYOCUzSG7LL9dq2ZcxzqXiEUrqVuudoq9tyF0hbdl+jciDw2PRKZTU38wmZAohNPDSf8 5rsw== X-Gm-Message-State: AOJu0YyOhYMX8UwD6iI9BTVLYkhq8XF8oMLMUgkC/sUBjzSARbdtpi7A 7AgbyI8JNCErwr7CQkB4TFzLlPhErRr3ccdNPOleNQ== X-Received: by 2002:ac2:59cf:0:b0:50a:71ec:a4ee with SMTP id x15-20020ac259cf000000b0050a71eca4eemr16884lfn.8.1700589876862; Tue, 21 Nov 2023 10:04:36 -0800 (PST) Received: from helsinki-03.engr ([2a01:4f9:6b:2a47::2]) by smtp.gmail.com with ESMTPSA id c33-20020a05651223a100b0050aa9ae127fsm1055758lfv.129.2023.11.21.10.04.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 10:04:36 -0800 (PST) From: Manolis Tsamis To: gcc-patches@gcc.gnu.org Cc: Philipp Tomsich , Jeff Law , Robin Dapp , Richard Sandiford , Manolis Tsamis Subject: [PATCH v2] ifcvt: Remove obsolete code for subreg handling in noce_convert_multiple_sets Date: Tue, 21 Nov 2023 19:04:34 +0100 Message-Id: <20231121180434.3991921-1-manolis.tsamis@vrull.eu> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, 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: 1783197758173278575 X-GMAIL-MSGID: 1783197758173278575 This code used to handle SUBREG for register replacement when ifcvt was doing the replacements manually. This special handling is not needed anymore because simplify_replace_rtx is used for the replacements and it properly handles these cases. gcc/ChangeLog: * ifcvt.cc (noce_convert_multiple_sets_1): Remove old code. Signed-off-by: Manolis Tsamis --- Changes in v2: - Made standalone patch. gcc/ifcvt.cc | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc index a0af553b9ff..be42609a848 100644 --- a/gcc/ifcvt.cc +++ b/gcc/ifcvt.cc @@ -3492,44 +3492,6 @@ noce_convert_multiple_sets_1 (struct noce_if_info *if_info, if (if_info->then_else_reversed) std::swap (old_val, new_val); - - /* We allow simple lowpart register subreg SET sources in - bb_ok_for_noce_convert_multiple_sets. Be careful when processing - sequences like: - (set (reg:SI r1) (reg:SI r2)) - (set (reg:HI r3) (subreg:HI (r1))) - For the second insn new_val or old_val (r1 in this example) will be - taken from the temporaries and have the wider mode which will not - match with the mode of the other source of the conditional move, so - we'll end up trying to emit r4:HI = cond ? (r1:SI) : (r3:HI). - Wrap the two cmove operands into subregs if appropriate to prevent - that. */ - - if (!CONSTANT_P (new_val) - && GET_MODE (new_val) != GET_MODE (temp)) - { - machine_mode src_mode = GET_MODE (new_val); - machine_mode dst_mode = GET_MODE (temp); - if (!partial_subreg_p (dst_mode, src_mode)) - { - end_sequence (); - return false; - } - new_val = lowpart_subreg (dst_mode, new_val, src_mode); - } - if (!CONSTANT_P (old_val) - && GET_MODE (old_val) != GET_MODE (temp)) - { - machine_mode src_mode = GET_MODE (old_val); - machine_mode dst_mode = GET_MODE (temp); - if (!partial_subreg_p (dst_mode, src_mode)) - { - end_sequence (); - return false; - } - old_val = lowpart_subreg (dst_mode, old_val, src_mode); - } - /* Try emitting a conditional move passing the backend the canonicalized comparison. The backend is then able to recognize expressions like