From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id ED2B83953825 for ; Wed, 16 Nov 2022 03:37:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ED2B83953825 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-x52a.google.com with SMTP id b62so15525826pgc.0 for ; Tue, 15 Nov 2022 19:37:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=A6VDfqwBdNdL6NrbQven8705bQKBkgyyDkblwAr/3wg=; b=gy4yy4RGkN3wDHgO3clmOTKNwk7v5eyCZ9OtsrXGwyYcdCGtcmyA/TVcH+ymfkUufJ DIVB2NlnDqYx+e1BUJxQkTGXSAfMuIPCSiJpM5vR+fIyknYNwUKg1TlIxvWNpO/KYcQk Jbo6/QFk3F5lFwvilpE1adhmUisbanARgVMrVVUBDz1bkdwCB3NWm4YLbEzktwbGYD5i MANIU+kJHeu7q9NS1cBZEBt50FsqPL5WZsslIzte8YF+Be5DrSEtRJVG/A+Dv/HXCowJ GCLKQTVvMjmyMoLcLhFf2M719AwX8ZaxdITtG2a4oxEXgUqe1TO6pdj2z+QAy00mTaEN wOwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=A6VDfqwBdNdL6NrbQven8705bQKBkgyyDkblwAr/3wg=; b=wCDVH9z9dAv52DeLi8O8hyf6SPX0DjQZ7Tojvi666QGHDFNafFWPhGIQKBYkxnYDbJ WEEgJfnayPFg5sS91obDZlZTwQObkSy5UMp7wghXD66oFKULGF9cEWaN2fyAdhbQeatw DcTowggPASEH5s8BXO/RyTSRAI+YmC9c/n/tPD1JfMNjAb6r5rkUaf6H0HGr/M6ZfFF1 0USo5GeLlrd5/7SIH6aiSHB+kOfUl+W7ZQd1CafKrTYXkE//uOUnYouDZiLBkjIWAY/3 IhFYCH28EuFQ2Gm2H9a5kVSz18l+/1ZRh2anN6C3IFcoarfnaf/3/uz6HTG707aD6yML ZHQA== X-Gm-Message-State: ANoB5plTriLaFqNbV3OWsJvti1ON0zmFGaQP1oTNjxq65mhBJy7U6zqB rI4f53Mr0vp4naNas1k1dFFpmUxDpu4= X-Google-Smtp-Source: AA0mqf4GtTLOQLE6Aw+2DqbmrFC3E/hwVfzOcGNEKTVVDjAOP/jBfIXge5VVTjYQruv4JnuvFARdfg== X-Received: by 2002:a63:1460:0:b0:46f:7b0d:3602 with SMTP id 32-20020a631460000000b0046f7b0d3602mr18749744pgu.143.1668569843704; Tue, 15 Nov 2022 19:37:23 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id h7-20020a170902f7c700b00186b945c0d1sm10772570plw.2.2022.11.15.19.37.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Nov 2022 19:37:22 -0800 (PST) Message-ID: <8ba05f30-5c6f-33a0-5144-2cf197886c28@gmail.com> Date: Tue, 15 Nov 2022 20:37:21 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] Add a target hook for sibcall epilogues Content-Language: en-US To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com References: From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On 11/11/22 09:22, Richard Sandiford via Gcc-patches wrote: > Epilogues for sibling calls are generated using the > sibcall_epilogue pattern. One disadvantage of this approach > is that the target doesn't know which call the epilogue is for, > even though the code that generates the pattern has the call > to hand. > > Although call instructions are currently rtxes, and so could be > passed as an operand to the pattern, the main point of introducing > rtx_insn was to move towards separating the rtx and insn types > (a good thing IMO). There also isn't an existing practice of > passing genuine instructions (as opposed to labels) to > instruction patterns. > > This patch therefore adds a hook that can be defined as an > alternative to sibcall_epilogue. The advantage is that it > can be passed the call; the disadvantage is that it can't > use .md conveniences like generating instructions from > textual patterns (although most epilogues are too complex > to benefit much from that anyway). > > Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? > > Richard > > > gcc/ > * doc/gccint/target-macros/miscellaneous-parameters.rst: > Add TARGET_EMIT_EPILOGUE_FOR_SIBCALL. > * doc/gccint/target-macros/tm.rst.in: Regenerate. > * target.def (emit_epilogue_for_sibcall): New hook. > * calls.cc (can_implement_as_sibling_call_p): Use it. > * function.cc (thread_prologue_and_epilogue_insns): Likewise. > (reposition_prologue_and_epilogue_notes): Likewise. > * config/aarch64/aarch64-protos.h (aarch64_expand_epilogue): Take > an rtx_call_insn * rather than a bool. > * config/aarch64/aarch64.cc (aarch64_expand_epilogue): Likewise. > (TARGET_EMIT_EPILOGUE_FOR_SIBCALL): Define. > * config/aarch64/aarch64.md (epilogue): Update call. > (sibcall_epilogue): Delete. Presumably you're going to do something useful with the new hook :-) OK. jeff