From nobody Wed Apr 16 16:15:27 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1603817808; cv=none; d=zohomail.com; s=zohoarc; b=I5o6s+xuWlD+jFdsPhk8rl9tcZxfV35ppbQ3LDaG/ow1qdLh7tt8WTE+xqYHtbDxAqNdOFKUkf/daiUx01lFny5BrdKO9qiCnFXBx7/IAk3sdjJz7ym73g68TMM1dANI0sUojuEkNDcbvTC99iVGL6pmdGwjstwP5DhT1v0nj9E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603817808; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=l4c7t48Ie241pwgULUUoEJnXqKB0sfr3ZrdrLJQD0q8=; b=e8Xdkvo0upjfj5yVdJpETt6qIWDU6LtSmNgeRdVe+sayMINYx69wcDMBlWxLlilOCR889/ReregUVsoLde3pwpEnl/+8gULF5EqhDsxQQYVC1DqkYdeCt4uSfYGrrNt5A02UvZlMvW/sMnXvqvxHH2pXCQkc+tIiXyFWwJ1YHxg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1603817808868280.4866512711634; Tue, 27 Oct 2020 09:56:48 -0700 (PDT) Received: from localhost ([::1]:42824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXSH9-0000TZ-Ui for importer@patchew.org; Tue, 27 Oct 2020 12:56:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXSBx-0003KK-A3 for qemu-devel@nongnu.org; Tue, 27 Oct 2020 12:51:25 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:40028) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXSBu-0004Rf-9p for qemu-devel@nongnu.org; Tue, 27 Oct 2020 12:51:24 -0400 Received: by mail-pf1-x42e.google.com with SMTP id w21so1247529pfc.7 for ; Tue, 27 Oct 2020 09:51:21 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id q16sm2955283pfj.117.2020.10.27.09.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 09:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l4c7t48Ie241pwgULUUoEJnXqKB0sfr3ZrdrLJQD0q8=; b=CiHWkFYGtjvojIFuuJhgfB8hhCPzI8v3+crXsbMSfQN4lnr1NFHv4PHPC63sv3rN0k BchGrxwK7DljmRBtrun4Ykd7TAl1QzC5Cv3If2Tqyu3kixmNK9o0dAefln8w50TccJT4 ays/ZNdcr2FFrLTMmjobcYHksFxBnJ+AyPP65//UELNSE3DXM8lZ1l8dygOYrB2cC/Cg DHYOUiuZJ5zssTy7sSDMS3YotKHZIL+FsFq62hev9X+C5nJOOoSVe25GIrOneLxdojXX QHEZWirEcw3ese+WRUZXrg8rLtFli5LDl24mZO8Nrb0klbyCTS3lEVaDRvXTtPgYs+I7 gByA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l4c7t48Ie241pwgULUUoEJnXqKB0sfr3ZrdrLJQD0q8=; b=einuG9DixxaXmaTDmKpgXUUpLs4L8h+AgzZfl4P3nsM8bOMZcUrIL9mqGwgCyZfhUk sBCZ5vQLpuWTMGn4z2Fwk8aM+vA21e7apiRP/mKO/iJPL50J1sQ6QLTay74Av2W2mHJ9 rn6xf8iFduyzAzXQu7E4iU/RCmXyNp9ABAftQokCv68DhSUlyTHxCVX3QB9/SFhvhZYI XJnTv0TYL1bnj6dk229riM5uxg78wdplArS9AIe/0THbK8gsu23S7RL9JGzCEp0ewSzj uvRLr3nnzVIMqjoU/5U6RoVV2p9ZZuP76sI2O6IGjalyiVWpFFkVEfJ2RdNw9eDQvz7y g5Zg== X-Gm-Message-State: AOAM530U9DH9Au7S7D+BUXAD71klLVHwrOlHr3TVIax+9Y1S3xAp5nfR OUsAEjCqvirbpPdYuT2VNY2ypjRsdEprEw== X-Google-Smtp-Source: ABdhPJzkZQGNXws9uH0UfuAa0mn7L/q7AbXG/1gskpG3XLdNJovUOFnLxGaOH66IPTs2Cb4tdCrOyg== X-Received: by 2002:a65:50c9:: with SMTP id s9mr2713518pgp.20.1603817480617; Tue, 27 Oct 2020 09:51:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 2/3] tcg/optimize: Flush data at labels not TCG_OPF_BB_END Date: Tue, 27 Oct 2020 09:51:13 -0700 Message-Id: <20201027165114.71508-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201027165114.71508-1-richard.henderson@linaro.org> References: <20201027165114.71508-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) We can easily propagate temp values through the entire extended basic block (in this case, the set of blocks connected by fallthru), simply by not discarding the register state at the branch. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson --- tcg/optimize.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 220f4601d5..9952c28bdc 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1484,29 +1484,30 @@ void tcg_optimize(TCGContext *s) } } } - goto do_reset_output; + /* fall through */ =20 default: do_default: - /* Default case: we know nothing about operation (or were unab= le - to compute the operation result) so no propagation is done. - We trash everything if the operation is the end of a basic - block, otherwise we only trash the output args. "mask" is - the non-zero bits mask for the first output arg. */ - if (def->flags & TCG_OPF_BB_END) { - bitmap_zero(temps_used.l, nb_temps); - } else { - do_reset_output: - for (i =3D 0; i < nb_oargs; i++) { - reset_temp(op->args[i]); - /* Save the corresponding known-zero bits mask for the - first output argument (only one supported so far). = */ - if (i =3D=3D 0) { - arg_info(op->args[i])->mask =3D mask; - } + /* + * Default case: we know nothing about operation (or were unab= le + * to compute the operation result) so no propagation is done. + */ + for (i =3D 0; i < nb_oargs; i++) { + reset_temp(op->args[i]); + /* + * Save the corresponding known-zero bits mask for the + * first output argument (only one supported so far). + */ + if (i =3D=3D 0) { + arg_info(op->args[i])->mask =3D mask; } } break; + + case INDEX_op_set_label: + /* Trash everything at the start of a new extended bb. */ + bitmap_zero(temps_used.l, nb_temps); + break; } =20 /* Eliminate duplicate and redundant fence instructions. */ --=20 2.25.1