From patchwork Tue Dec 25 20:55:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 154502 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5222388ljp; Tue, 25 Dec 2018 13:19:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN4vspyaLKO46Mckc+U7AXFaDWIhb9DWcmewPulyByElZ9J32Y//Q9CjgCi5ffUEEkqFyoK8 X-Received: by 2002:a0c:98ca:: with SMTP id g10mr16520751qvd.13.1545772790182; Tue, 25 Dec 2018 13:19:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545772790; cv=none; d=google.com; s=arc-20160816; b=ccvcrspwVzyZd4m7HLfVJckRa7I6YXs1U1VfenIahbui+HKbYMWT4uRVBc564ybxr/ tNz19R5S5J4twu+iK9JJ/aT410muE3g1Y/wDcose39qPEtawQLmPw+MurtlzgAzSBXNp Kv9yqa6In4pMntT0gTDRwJJSpP84ywwREzNckLidQmvQr0tgggf9SJKjx9HQ6hHv5VaZ C8eqNGbw9juA/KStFRNQLAiiZT3yP6y67Mmlih9p5PEeSexUyr3c/FyHEImcpDd9EGgF sKD5Q44SgWYT8jq6RxL+FTTCH81lJcCnZziS3baCKk2f2wfeG8CsIPoz5GGguGke0WK7 iFLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=bP4bYVfU2+CPyEjchyusBBmjR/FH+f6pPTkVIMjmtoE=; b=GLAPLUvIvMDbVPaVu87qrEJOG9DZMnfASHVdAFYgwZW3YrL0Yti9TUte8znrK+dNmU RtxJZ6pfwVNdzC83/5/M5itIebG9mR+LNI17P2Z4y98NwrZqNS1sTy0rexUxOhirQpYE s7/MSXti5oYAL7DfD8SsBz47I9kbsEb8FteLM42RY/bj7VRir/6tpsGdGT4ZeJ6QAww7 RNM+UivxnR6mbBqkajwjbBC1aBlH2WeU547bxMqumG727bPpQHJbZH7qudTA2CSqNdkX MNvs9wVbB91MV5kMOpJDEI68g/AZMRQV2UJX3/bFoI/8xtyNYlpgxDteADwaaa99owXN NgtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E+tvo639; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id o24si1634140qkl.147.2018.12.25.13.19.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 25 Dec 2018 13:19:50 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E+tvo639; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:43235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbu7B-0000mA-HZ for patch@linaro.org; Tue, 25 Dec 2018 16:19:49 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbtnx-0008JZ-BQ for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:59:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gbtnu-0001oZ-6S for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:59:57 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:44006) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gbtnt-0001nx-VA for qemu-devel@nongnu.org; Tue, 25 Dec 2018 15:59:54 -0500 Received: by mail-pf1-x430.google.com with SMTP id w73so7069581pfk.10 for ; Tue, 25 Dec 2018 12:59:53 -0800 (PST) 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; bh=bP4bYVfU2+CPyEjchyusBBmjR/FH+f6pPTkVIMjmtoE=; b=E+tvo639wwvArNaSA1Dr8frRVtCRD3FHl+RF1trIJNdScexwBhWZJLDjiir44+hHqd 5IWzOyDK4EMUUII7OuXIthCKicteXLk1R/q7aVpDSEXuMZ14BhOTy4We5zLj+UAqEX9T NzsfYBZuq0gGBoRpPvMkAGZIVuy6DFQvO7FzY= 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; bh=bP4bYVfU2+CPyEjchyusBBmjR/FH+f6pPTkVIMjmtoE=; b=b9g7GXNaNDDkBJzTAGvRfkzKctNkag40svIXYy3GrmcizDwdsu0jnUQ+/VPQ0VGEln 3bV8DQEZd4iG8uRNfu/g82yAicT9Lt75LxVTUjN1x4q1hNuJ5M/zG7N1ko5xnrBGx/v8 blry/Q4PS7Nv2AbebVtfpiy9bZDMcQieCDS88AzYT/SarXueQKDbce2mGCuxsrrZObnJ WVA7r6T8fSYIuKRxgVAGo1rIWVn7+vSRn+QkQAIZZ5c4yVAf7xy6mLVAwG2YXhE6E4/v afDz03HWb1fMk1WsCq2ZCD/B1Lbn0y9ZyFX0GE+VOqwPCqS+NEgi+ByrFOYFY1edPS8b uUDA== X-Gm-Message-State: AJcUukfGZzYlEgX1J8Khiq5+3HXaSkiFN713Bg6k9Lo6yaSh8mlSPhqo TjJhYoTAOlEn1MBTFqzViTvctlCwFKQ= X-Received: by 2002:a63:160d:: with SMTP id w13mr12564270pgl.43.1545771592654; Tue, 25 Dec 2018 12:59:52 -0800 (PST) Received: from cloudburst.home (c211-28-135-144.sunsh3.vic.optusnet.com.au. [211.28.135.144]) by smtp.gmail.com with ESMTPSA id t21sm48501628pgg.24.2018.12.25.12.59.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Dec 2018 12:59:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 26 Dec 2018 07:55:24 +1100 Message-Id: <20181225205529.10874-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181225205529.10874-1-richard.henderson@linaro.org> References: <20181225205529.10874-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::430 Subject: [Qemu-devel] [PULL 37/42] tcg: Reindent parts of liveness_pass_1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There are two blocks of the form if (foo) { stuff1; goto bar; } else { baz: stuff2; } which have unnecessary and confusing indentation. Remove the else and unindent stuff2. Reviewed-by: Emilio G. Cota Signed-off-by: Richard Henderson --- tcg/tcg.c | 139 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 71 insertions(+), 68 deletions(-) -- 2.17.2 diff --git a/tcg/tcg.c b/tcg/tcg.c index e2ae04d1d0..696a45f7f8 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2436,47 +2436,46 @@ static void liveness_pass_1(TCGContext *s) } } goto do_remove; - } else { - do_not_remove_call: + } + do_not_remove_call: - /* output args are dead */ - for (i = 0; i < nb_oargs; i++) { - arg_ts = arg_temp(op->args[i]); - if (arg_ts->state & TS_DEAD) { - arg_life |= DEAD_ARG << i; - } - if (arg_ts->state & TS_MEM) { - arg_life |= SYNC_ARG << i; - } - arg_ts->state = TS_DEAD; + /* output args are dead */ + for (i = 0; i < nb_oargs; i++) { + arg_ts = arg_temp(op->args[i]); + if (arg_ts->state & TS_DEAD) { + arg_life |= DEAD_ARG << i; } + if (arg_ts->state & TS_MEM) { + arg_life |= SYNC_ARG << i; + } + arg_ts->state = TS_DEAD; + } - if (!(call_flags & (TCG_CALL_NO_WRITE_GLOBALS | - TCG_CALL_NO_READ_GLOBALS))) { - /* globals should go back to memory */ - for (i = 0; i < nb_globals; i++) { - s->temps[i].state = TS_DEAD | TS_MEM; - } - } else if (!(call_flags & TCG_CALL_NO_READ_GLOBALS)) { - /* globals should be synced to memory */ - for (i = 0; i < nb_globals; i++) { - s->temps[i].state |= TS_MEM; - } + if (!(call_flags & (TCG_CALL_NO_WRITE_GLOBALS | + TCG_CALL_NO_READ_GLOBALS))) { + /* globals should go back to memory */ + for (i = 0; i < nb_globals; i++) { + s->temps[i].state = TS_DEAD | TS_MEM; } + } else if (!(call_flags & TCG_CALL_NO_READ_GLOBALS)) { + /* globals should be synced to memory */ + for (i = 0; i < nb_globals; i++) { + s->temps[i].state |= TS_MEM; + } + } - /* record arguments that die in this helper */ - for (i = nb_oargs; i < nb_iargs + nb_oargs; i++) { - arg_ts = arg_temp(op->args[i]); - if (arg_ts && arg_ts->state & TS_DEAD) { - arg_life |= DEAD_ARG << i; - } + /* record arguments that die in this helper */ + for (i = nb_oargs; i < nb_iargs + nb_oargs; i++) { + arg_ts = arg_temp(op->args[i]); + if (arg_ts && arg_ts->state & TS_DEAD) { + arg_life |= DEAD_ARG << i; } - /* input arguments are live for preceding opcodes */ - for (i = nb_oargs; i < nb_iargs + nb_oargs; i++) { - arg_ts = arg_temp(op->args[i]); - if (arg_ts) { - arg_ts->state &= ~TS_DEAD; - } + } + /* input arguments are live for preceding opcodes */ + for (i = nb_oargs; i < nb_iargs + nb_oargs; i++) { + arg_ts = arg_temp(op->args[i]); + if (arg_ts) { + arg_ts->state &= ~TS_DEAD; } } } @@ -2580,43 +2579,47 @@ static void liveness_pass_1(TCGContext *s) goto do_not_remove; } } - do_remove: - tcg_op_remove(s, op); - } else { - do_not_remove: - /* output args are dead */ - for (i = 0; i < nb_oargs; i++) { - arg_ts = arg_temp(op->args[i]); - if (arg_ts->state & TS_DEAD) { - arg_life |= DEAD_ARG << i; - } - if (arg_ts->state & TS_MEM) { - arg_life |= SYNC_ARG << i; - } - arg_ts->state = TS_DEAD; - } + goto do_remove; + } + goto do_not_remove; - /* if end of basic block, update */ - if (def->flags & TCG_OPF_BB_END) { - tcg_la_bb_end(s); - } else if (def->flags & TCG_OPF_SIDE_EFFECTS) { - /* globals should be synced to memory */ - for (i = 0; i < nb_globals; i++) { - s->temps[i].state |= TS_MEM; - } - } + do_remove: + tcg_op_remove(s, op); + break; - /* record arguments that die in this opcode */ - for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) { - arg_ts = arg_temp(op->args[i]); - if (arg_ts->state & TS_DEAD) { - arg_life |= DEAD_ARG << i; - } + do_not_remove: + /* output args are dead */ + for (i = 0; i < nb_oargs; i++) { + arg_ts = arg_temp(op->args[i]); + if (arg_ts->state & TS_DEAD) { + arg_life |= DEAD_ARG << i; } - /* input arguments are live for preceding opcodes */ - for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) { - arg_temp(op->args[i])->state &= ~TS_DEAD; + if (arg_ts->state & TS_MEM) { + arg_life |= SYNC_ARG << i; } + arg_ts->state = TS_DEAD; + } + + /* if end of basic block, update */ + if (def->flags & TCG_OPF_BB_END) { + tcg_la_bb_end(s); + } else if (def->flags & TCG_OPF_SIDE_EFFECTS) { + /* globals should be synced to memory */ + for (i = 0; i < nb_globals; i++) { + s->temps[i].state |= TS_MEM; + } + } + + /* record arguments that die in this opcode */ + for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) { + arg_ts = arg_temp(op->args[i]); + if (arg_ts->state & TS_DEAD) { + arg_life |= DEAD_ARG << i; + } + } + /* input arguments are live for preceding opcodes */ + for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) { + arg_temp(op->args[i])->state &= ~TS_DEAD; } break; }