From patchwork Wed Oct 18 22:25:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735139 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1236557wro; Wed, 18 Oct 2023 15:27:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCfhSq3wWU9xcC6eBZHHdQGG/Y2NyP7wZUKvtC9t12zYR5mgDW58E93jwrb7K1+AKR56sR X-Received: by 2002:a05:622a:118c:b0:413:5d52:ee17 with SMTP id m12-20020a05622a118c00b004135d52ee17mr777395qtk.42.1697668022860; Wed, 18 Oct 2023 15:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697668022; cv=none; d=google.com; s=arc-20160816; b=gV+HDBxazZYVUNz0LnOj7V3TAIfAUtzv7aU6ldxtWWiDaxW8Dbjk7rqQwUjmg0Fx/S 9ue2NguX6TxCffoO3EgggyKC1WbhZVT3CDhj3u1hRkXuoIM5eBsHlA+UvCun49k4uh9Q iWZQt30Ru/p5jw5unzMgVOumqfAh4O1PHbQVJne8Nu1jMTGJ6ClukiItx6uw1H1bWKmU M4VfLCC6VaDIkUsjfgdfw7AJUPNzYr0kGkQNegtiG8mJAghivT4lzoT85JZxUfH78ZTA qEKMgKe2/oH2tOP/wXw8T3kOSSQD1mEkBf+WEM9h+W127opmJxU19dp656lrG92mcO5m MaFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=QOgygXHDxUHtfSFg6wMi8J9He8Jq0o2OiYkY7oLrEpM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=mObka6LTN3g1uK12Sqxv+3x1I2CXOE4X8bxGN/sa76pxiH8TxCh31EMIG8P5SnL7Rc +hwAShMyeH0caBcgYSz796MUaXycPhX//TYaFdqcQmnnyCBmYF9Ea0rO95RaE0EBnzZh 0snmtYjvxFB7LvwemuP0VIa+rBjvTTe5WLXC7FqNIWxTSLBfdcLtLqOovwYNPbjWnTiD 9Bpy9AUfWUyq+YQq1DBxd/smZg/ByPPrsNkQBQPVd/pvVNxsSt6Pjcd2fU+zh83y9hrq bOvshUucHi+q3oHTKtCICN09L3pgiCCBPSGyl8kk2Hk3kAq6a4hbqSKEsUUpATD7lrx1 h+5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TrBpgvRJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s7-20020ac85cc7000000b004120387cd29si688554qta.127.2023.10.18.15.27.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:27:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TrBpgvRJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtEzk-0008Dj-LY; Wed, 18 Oct 2023 18:26:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtEzh-0008CC-UE for qemu-devel@nongnu.org; Wed, 18 Oct 2023 18:26:26 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtEzg-0002Wj-9c for qemu-devel@nongnu.org; Wed, 18 Oct 2023 18:26:25 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1ca6809fb8aso27745655ad.1 for ; Wed, 18 Oct 2023 15:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697667983; x=1698272783; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=QOgygXHDxUHtfSFg6wMi8J9He8Jq0o2OiYkY7oLrEpM=; b=TrBpgvRJH7NywtdKrlwyN3vLPadSu/sRKc0LCCoZpQmPfEGpMla1fVP5P+jB86+Lpo 90Iqj4f10yNrMDf9Bln00p6opZ4sca96/IReDh51ZgoDdPQYJmyGykTnZC4ZgGYcH+78 3tj4n8tYs6yAbTcH2YdvdzzHYEoSW3nUcujQfWaldtokrEx73H/W1yODrTTwdMWd9W29 r2NHw4B1ZO85173Ocmk2/+8HfE36sv2zql1lH2RR5+iROQXcQidzjLljwuvEFfXKIuW6 DZCNCVjsEjumv4VmsoKHJXyufvs7pxBMlh9+cGom8rRrjcfQdP36io2H25gSQlbktJfP XYWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697667983; x=1698272783; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QOgygXHDxUHtfSFg6wMi8J9He8Jq0o2OiYkY7oLrEpM=; b=BX/cO+c/8IlA1X6GB6VzRY1E2rPzI8jUZEiFbKduq+3v5fG0WrvBRs/1KYOmrUg2wl VDkgFrYFlkqd6MEBEiX0D3OSH+OCoiSm5kIOTXlb07p1o4xjh3iTzCDniiHq/pwRYko9 I8QuEeo92Zy2vHDXm0J9+9Kdr0nJ+JN4/hBhP3XUa3KtTQXaU8zU/mHmvCNaZyDijrHu xrRX764BzT2pHh6/9GjqtDdd3nfAO4wlwd4jl0Kio2YIjKA50erHT2480FlUQgISMaZR Qqw6IsPYbSiNCdW+Gjl+BDXvxLGkhRQi2IKMfvCxGH1+Mluyb0IQ/hfDVaBwnaISnFHB PcuQ== X-Gm-Message-State: AOJu0Yywdm8opzHrV3isAS95l0e3v4VPSW4xk33IuABMwrVJJQ/aSoF+ OTZKckIdq7h7qJOO5ETdnVmBf3PJcAAXdQNAH5Y= X-Received: by 2002:a17:902:f38b:b0:1c9:d667:4e85 with SMTP id f11-20020a170902f38b00b001c9d6674e85mr643466ple.40.1697667982778; Wed, 18 Oct 2023 15:26:22 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id 13-20020a170902c24d00b001b9d95945afsm431058plg.155.2023.10.18.15.26.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 15:26:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 27/29] tcg: Optimize past conditional branches Date: Wed, 18 Oct 2023 15:25:55 -0700 Message-Id: <20231018222557.1562065-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018222557.1562065-1-richard.henderson@linaro.org> References: <20231018222557.1562065-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We already register allocate through extended basic blocks, optimize through extended basic blocks as well. Signed-off-by: Richard Henderson --- tcg/optimize.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 3013eb04e6..2db5177c32 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -688,12 +688,14 @@ static void finish_folding(OptContext *ctx, TCGOp *op) int i, nb_oargs; /* - * For an opcode that ends a BB, reset all temp data. - * We do no cross-BB optimization. + * We only optimize extended basic blocks. If the opcode ends a BB + * and is not a conditional branch, reset all temp data. */ if (def->flags & TCG_OPF_BB_END) { - memset(&ctx->temps_used, 0, sizeof(ctx->temps_used)); ctx->prev_mb = NULL; + if (!(def->flags & TCG_OPF_COND_BRANCH)) { + memset(&ctx->temps_used, 0, sizeof(ctx->temps_used)); + } return; }