From patchwork Wed Feb 5 21:31:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1234028 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-518988-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=dIIpWZsy; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=jIelM7s4; dkim-atps=neutral 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 48CZXP6DZ5z9sRK for ; Thu, 6 Feb 2020 08:32:21 +1100 (AEDT) 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=dTGYn7kkOGXeuaSXEP9rEXfqZTaZiu3bx807/22NMiB1xi 3OoHeCseC0u796wmeSmVgxh62znV+mkdyGLTNnYPjvDA6+Z0/CKzZkn4H8POzIty H5fmLuhtIXC5HelYoh4ol8SyXVgzUJdx5bQOth45MJLRDoY2ckpBJK4DN2nlM= 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=1geAi9WLeb5esblxbyf9QAzdj3Y=; b=dIIpWZsyfYR5RmeWKgp6 hBo7pnFY4Q17WdDC+VxA85zY6yfaIUHoWk+MNzb9zfdFCplhfmMQO0aC7reRw4NA Tdj9sVqz5W4MDt9lE4Qtu4zXHQSe8rGc6ZMpNsZXcxO6D2EMjA4z2SzZEJ1AADOm zizqLbX1FdC019IRJCSCz5M= Received: (qmail 130650 invoked by alias); 5 Feb 2020 21:32:14 -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 130641 invoked by uid 89); 5 Feb 2020 21:32:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Received:sk:r12mr28 X-HELO: mail-io1-f48.google.com Received: from mail-io1-f48.google.com (HELO mail-io1-f48.google.com) (209.85.166.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Feb 2020 21:32:12 +0000 Received: by mail-io1-f48.google.com with SMTP id k24so3911847ioc.4 for ; Wed, 05 Feb 2020 13:32:12 -0800 (PST) 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=8HVCz5a4StTDlL/Bi/ps+pKRC/edWq6OCTXEUH4TxPU=; b=jIelM7s4oxoUs8r9RSc++inK/bpg9Qp+LOLB7FqAZlR0gkbghuDeAo8BzC+BKuLC4g 90y97X6kdR8Ek6bDnRqnom0f71rTPdP0ioIzes7R982E6sH3PhtuNuqyRZKc1dodxMbB Ni5oZDSI5ib4O+VBGm3supxGvz6SaxeQmxK3nGWP//EQ9qrejFhpnLfcv8eQVultZCbS PnguAzkyu/yHLvyVlX5/gPp2w0FpXhe4BhXkX1aySfFU4+hcDnkhl7D2Bd8yWNMY5CRq G3IH261iYPXPvD6h2zu/uhHfSSj5c0D99l3/3AjKub/qh+fcku10VqZXB5ShM5Mp77Ny eDTA== MIME-Version: 1.0 From: Uros Bizjak Date: Wed, 5 Feb 2020 22:31:59 +0100 Message-ID: Subject: [committed] x86: Simplify post epilogue_completed splitters. To: "gcc-patches@gcc.gnu.org" Simplify post epilogue_completed splitters. Now that we have post epilogue_completed split point for all optimization levels, we can simplify post epilogue_completed splitters considerably. If corresponding define_peephole2 pattern fails to allocate a temporary register (or if peephole2 pass isn't run at all), we can now always split invalid RTX after epilogue_completed is set. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. * config/i386/i386.md (*pushdi2_rex64 peephole2): Remove. (*pushdi2_rex64 peephole2): Unconditionally split after epilogue_completed. (*ashl3_doubleword): Ditto. (*3_doubleword): Ditto. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 46b442dae51..496a8666643 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -1688,38 +1688,21 @@ ;; First try to get scratch register and go through it. In case this ;; fails, push sign extended lower part first and then overwrite ;; upper part by 32bit move. + (define_peephole2 [(match_scratch:DI 2 "r") (set (match_operand:DI 0 "push_operand") (match_operand:DI 1 "immediate_operand"))] - "TARGET_64BIT && !symbolic_operand (operands[1], DImode) + "TARGET_64BIT + && !symbolic_operand (operands[1], DImode) && !x86_64_immediate_operand (operands[1], DImode)" [(set (match_dup 2) (match_dup 1)) (set (match_dup 0) (match_dup 2))]) -;; We need to define this as both peepholer and splitter for case -;; peephole2 pass is not run. -;; "&& 1" is needed to keep it from matching the previous pattern. -(define_peephole2 - [(set (match_operand:DI 0 "push_operand") - (match_operand:DI 1 "immediate_operand"))] - "TARGET_64BIT && !symbolic_operand (operands[1], DImode) - && !x86_64_immediate_operand (operands[1], DImode) && 1" - [(set (match_dup 0) (match_dup 1)) - (set (match_dup 2) (match_dup 3))] -{ - split_double_mode (DImode, &operands[1], 1, &operands[2], &operands[3]); - - operands[1] = gen_lowpart (DImode, operands[2]); - operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (Pmode, stack_pointer_rtx, - GEN_INT (4))); -}) - (define_split [(set (match_operand:DI 0 "push_operand") (match_operand:DI 1 "immediate_operand"))] - "TARGET_64BIT && ((optimize > 0 && flag_peephole2) - ? epilogue_completed : reload_completed) + "TARGET_64BIT && epilogue_completed && !symbolic_operand (operands[1], DImode) && !x86_64_immediate_operand (operands[1], DImode)" [(set (match_dup 0) (match_dup 1)) @@ -10586,7 +10569,7 @@ (ashift:DWI (match_operand:DWI 1 "nonmemory_operand") (match_operand:QI 2 "nonmemory_operand"))) (clobber (reg:CC FLAGS_REG))] - "(optimize && flag_peephole2) ? epilogue_completed : reload_completed" + "epilogue_completed" [(const_int 0)] "ix86_split_ashl (operands, NULL_RTX, mode); DONE;") @@ -11338,7 +11321,7 @@ (clobber (reg:CC FLAGS_REG))] "" "#" - "(optimize && flag_peephole2) ? epilogue_completed : reload_completed" + "epilogue_completed" [(const_int 0)] "ix86_split_ (operands, NULL_RTX, mode); DONE;" [(set_attr "type" "multi")])