From patchwork Wed Jun 19 14:41:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1118760 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-503270-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45TSMH5Nkqz9s00 for ; Thu, 20 Jun 2019 00:41:45 +1000 (AEST) 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=IkCxalZAaZHZ7HeEuAUxO3FL2fdlVm+rE6yccp885GExxx 1akZFIXrMwlITHCtqB2/HlQG53xBo0NjNFI3PyIpRhvfjdC6jzfI7BBus9WOYZnI wyKKxb0tycVJN8iqdWEqWF1SvPLo/1y/sGfX040lVaet5vReW70LnZlLmUyyQ= 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=teXMHaoamWSZQKP6OBGfjmGea/o=; b=GpFCYInz76fZnCEfgwvR hH/5lB5c3Jl/5Fk10lWX7Ki0UdserxxfLR3d2kgZHiRuxGxyn/Jlu5OBRDyOO9Wr Iqbpv3jWEsvofG9eCNUKgtqIWymKlqIQeoyZsr2i/0w6s0MwEr/oucsGtWSf1kKE 20zYuxgO8AzPeIpVsx7oDJY= Received: (qmail 71781 invoked by alias); 19 Jun 2019 14:41:36 -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 71772 invoked by uid 89); 19 Jun 2019 14:41:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=string_cst, STRING_CST X-HELO: mail-io1-f46.google.com Received: from mail-io1-f46.google.com (HELO mail-io1-f46.google.com) (209.85.166.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Jun 2019 14:41:34 +0000 Received: by mail-io1-f46.google.com with SMTP id n5so38671467ioc.7 for ; Wed, 19 Jun 2019 07:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Dwvoz8codRfWmDIe6vmhiGvF+al7pWGxrvwhM/z0NqE=; b=gAO3lzjCisuAjNy5W7eM3rt9eqdApheT3ZXuREl/PsSilIJzsdbpXwGhlpQMF8nX0p nkfuwYlqKte8kjdbr2sSwkjpFxYuMdZCttuh57aShvNkf29j8Et8RjnFWdv5TOfijCkR aOGNZLLlXqgUVx5k4PTzp8vPrvlJNFAubKPVubbC1ZIag1rEdNiNVEZFZHD77mT588Td eBt9RMoPL9dKtnL78X/1LRR4LmhAPk2bEzAJVAmHm2FzPEzOLDfTMTpqjJjg6slH3OER uvuGs++TSGkQSiw2Ic+k7bws6xD0GuUmxrTXH68Z95oqSMlx2VGmbRg+hwIcv4XCTVu6 RsHw== MIME-Version: 1.0 From: Uros Bizjak Date: Wed, 19 Jun 2019 16:41:21 +0200 Message-ID: Subject: [PATCH, i386]: Remove dead code from cmpstrnsi expander To: "gcc-patches@gcc.gnu.org" Operand 0 is always a register due to register_operand predicate. 2019-06-19 Uroš Bizjak * config/i386/i386.md (cmpstrnsi): Remove dead code. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Committed to mainline SVN. Uros. Index: config/i386/i386.md =================================================================== --- config/i386/i386.md (revision 272473) +++ config/i386/i386.md (working copy) @@ -17004,7 +17004,7 @@ (use (match_operand 4 "immediate_operand"))] "" { - rtx addr1, addr2, out, outlow, count, countreg, align; + rtx addr1, addr2, countreg, align, out; if (optimize_insn_for_size_p () && !TARGET_INLINE_ALL_STRINGOPS) FAIL; @@ -17028,10 +17028,6 @@ && TREE_CODE (TREE_OPERAND (TREE_OPERAND (t2, 0), 0)) == STRING_CST))) FAIL; - out = operands[0]; - if (!REG_P (out)) - out = gen_reg_rtx (SImode); - addr1 = copy_addr_to_reg (XEXP (operands[1], 0)); addr2 = copy_addr_to_reg (XEXP (operands[2], 0)); if (addr1 != XEXP (operands[1], 0)) @@ -17039,8 +17035,7 @@ if (addr2 != XEXP (operands[2], 0)) operands[2] = replace_equiv_address_nv (operands[2], addr2); - count = operands[3]; - countreg = ix86_zero_extend_to_Pmode (count); + countreg = ix86_zero_extend_to_Pmode (operands[3]); /* %%% Iff we are testing strict equality, we can use known alignment to good advantage. This may be possible with combine, particularly @@ -17047,9 +17042,9 @@ once cc0 is dead. */ align = operands[4]; - if (CONST_INT_P (count)) + if (CONST_INT_P (operands[3])) { - if (INTVAL (count) == 0) + if (operands[3] == const0_rtx) { emit_move_insn (operands[0], const0_rtx); DONE; @@ -17064,13 +17059,10 @@ operands[1], operands[2])); } - outlow = gen_lowpart (QImode, out); - emit_insn (gen_cmpintqi (outlow)); - emit_move_insn (out, gen_rtx_SIGN_EXTEND (SImode, outlow)); + out = gen_lowpart (QImode, operands[0]); + emit_insn (gen_cmpintqi (out)); + emit_move_insn (operands[0], gen_rtx_SIGN_EXTEND (SImode, out)); - if (operands[0] != out) - emit_move_insn (operands[0], out); - DONE; }) @@ -19320,7 +19312,7 @@ (match_operand:SI 2 "const_int_operand"))] "TARGET_3DNOW || TARGET_PREFETCH_SSE || TARGET_PRFCHW || TARGET_PREFETCHWT1" { - bool write = INTVAL (operands[1]) != 0; + bool write = operands[1] != const0_rtx; int locality = INTVAL (operands[2]); gcc_assert (IN_RANGE (locality, 0, 3)); @@ -19385,7 +19377,7 @@ (const_int 3))] "TARGET_3DNOW || TARGET_PRFCHW || TARGET_PREFETCHWT1" { - if (INTVAL (operands[1]) == 0) + if (operands[1] == const0_rtx) return "prefetch\t%a0"; else return "prefetchw\t%a0";