From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by sourceware.org (Postfix) with ESMTPS id CAC6238930CC for ; Wed, 22 Jul 2020 12:24:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CAC6238930CC Received: by mail-ed1-x543.google.com with SMTP id d18so1505150edv.6 for ; Wed, 22 Jul 2020 05:24:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RLlMWS8OSkUHCdrkK05zHWqfMz/ZlM/i8FMOuWA5vMM=; b=ekdSQ4WEc9XOGt5kaJxU5SMfNHsCjKkabiuO9ZSssTyF9NWm8qwCsg69oHJFfn+Jsh 3C2KX5VwUDDWFB7iw3dK+VLrnNAbz/NwlIf5aNukdYbLqwqtGz9ZeIbcbAFgn9zF/AcD B8QKfYNp+Raw6meXRya2seHa3UX4ZuzwWKo0NjhEUNkZMzQz2fQS/VYX69XCVnwdqKjw a98SGM8ZbbiE5lhCt9igPvj5hBPcJjeyPGsjaDpY/xEENCC6Vv0uubGz6RqEDBTrJJFh duRt7b9ZsiKY8KQLovEBdxMTZxRAt/b26Q+mujqS72oksycgKEvjTOOKCHmi9rctDi0m v1zA== X-Gm-Message-State: AOAM533n/ugKNimCdmReD5+vjoBDWdDfdL5Yv7fMawQa99v74+B7wrap s7KQxuzouUEk4I8akKeyOd9tWNh46H7KTAag4hA= X-Google-Smtp-Source: ABdhPJxyTSnR8uwxSMa/gHJ/8KcudGqhvfQcCG1uJ0hhWtPIbOTciOVrdHk6m7z41YcS4ztj1WmenJzRYOWAMTix6v0= X-Received: by 2002:aa7:d5da:: with SMTP id d26mr19105536eds.248.1595420657902; Wed, 22 Jul 2020 05:24:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Wed, 22 Jul 2020 14:24:06 +0200 Message-ID: Subject: Re: [PATCH 1/2] Add new RTX instruction class FILLER_INSN To: Andrea Corallo Cc: GCC Patches , nd , Richard Earnshaw Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2020 12:24:20 -0000 On Wed, Jul 22, 2020 at 12:03 PM Andrea Corallo wrote: > > Hi all, > > I'd like to submit the following two patches implementing a new AArch64 > specific back-end pass that helps optimize branch-dense code, which can > be a bottleneck for performance on some Arm cores. This is achieved by > padding out the branch-dense sections of the instruction stream with > nops. > > The original patch was already posted some time ago: > > https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg200721.html > > This follows up splitting as suggested in two patches, rebasing on > master and implementing the suggestions of the first code review. > > This first patch implements the addition of a new RTX instruction class > FILLER_INSN, which has been white listed to allow placement of NOPs > outside of a basic block. This is to allow padding after unconditional > branches. This is favorable so that any performance gained from > diluting branches is not paid straight back via excessive eating of > nops. > > It was deemed that a new RTX class was less invasive than modifying > behavior in regards to standard UNSPEC nops. > > 1/2 is requirement for 2/2. Please see this the cover letter of this last > for more details on the pass itself. I wonder if such effect of instructions on the pipeline can be modeled in the DFA and thus whether the scheduler could issue (always ready) NOPs? I also wonder whether such optimization is better suited for the assembler which should know instruction lengths and alignment in a more precise way and also would know whether extra nops make immediates too large for pc relative things like short branches or section anchor accesses (or whatever else)? Richard. > Regards > > Andrea > > gcc/ChangeLog > > 2020-07-17 Andrea Corallo > Carey Williams > > * cfgbuild.c (inside_basic_block_p): Handle FILLER_INSN. > * cfgrtl.c (rtl_verify_bb_layout): Whitelist FILLER_INSN outside > basic blocks. > * coretypes.h: New rtx class. > * emit-rtl.c (emit_filler_after): New function. > * rtl.def (FILLER_INSN): New rtl define. > * rtl.h (rtx_filler_insn): Define new structure. > (FILLER_INSN_P): New macro. > (is_a_helper ::test): New test helper for > rtx_filler_insn. > (emit_filler_after): New extern. > * target-insns.def: Add target insn definition.