From patchwork Wed Nov 28 05:38:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 152190 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp692337ljp; Tue, 27 Nov 2018 21:48:12 -0800 (PST) X-Google-Smtp-Source: AJdET5dEvMjKtXTgN4C8fbOgYIbudKx4F9mzTQw3AWjdi1Ez3mfQFQ6JKlpYCjKdZB1xyvKzIGxZ X-Received: by 2002:a81:b623:: with SMTP id u35mr37382849ywh.177.1543384092408; Tue, 27 Nov 2018 21:48:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543384092; cv=none; d=google.com; s=arc-20160816; b=XNNafkD5g4YUg9/0Te9rBIgAiySxhxyHvANhAAoNG1E8gSG67UpONz9EJDHURZG6h6 nxerED0xjORIJlrLLfG/fBhEORfDT1K5jH7F7sJZdq45FHauxY5EcEbREiH5TNYM9Kbp VgmqbU3RC0Vu82dtU+Lf4EBFT7f5zggmt0CgD0jVLhkt+B5KfekvLkEgAxWVTsslFLQm ZQyUxcuqI69p3kEYA3Tqrb74IMn6r8wY9OKQjt9uI2XCQnuYjvE0oejrw6sxlNaRNfIa LRucrKtA4okB8V4L0NJpQ83olje+/v0lsZxcVumX04qEh4GHoBlJVObSDQLSrI08egJ1 221w== 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=MI9Pri5ZPTaghx1rn22lpK9ksOlRXxZIuJM3sUOWfKI=; b=OXvqIxjqRnr+djp9NrbbW09qFKUbno7ZZSRA4L2aT0BFaWunH/VjL5aCLL/577V0pa pNoLbvq8hh8BS89NYqKAOZ8xaZGQuT4vtgoiDgp8n4eprZy91bbPztnMRI+RAoG7LY4Z QhOZ0BP8/fAV7i8B2nSXUuYecQ+SHtpnF/ujn9NuK6+/KjJHfB8LhPzUsEd8gAik/yvZ 84DNYrPFNQA4JSmBMkXN9diLfnjcW7ISYwNYwRKgQAAqaadnI3jX138PPB7h5RhK0VnR QrtHz63hPpU15DF75xcXjpGZWtHblVwJ2FC8A2b77N36lbw5C3JJ58yKZdW5pPF/yi8f zlgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=keiU5G5A; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 1si4232617ywx.421.2018.11.27.21.48.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 27 Nov 2018 21:48:12 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=keiU5G5A; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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 ([::1]:46075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRshn-0005HC-PZ for patch@linaro.org; Wed, 28 Nov 2018 00:48:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRsYl-000416-Rb for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRsYi-0004Mt-OD for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:51 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:43688) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRsYi-0004Lv-G2 for qemu-devel@nongnu.org; Wed, 28 Nov 2018 00:38:48 -0500 Received: by mail-pg1-x543.google.com with SMTP id v28so8963261pgk.10 for ; Tue, 27 Nov 2018 21:38:47 -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=MI9Pri5ZPTaghx1rn22lpK9ksOlRXxZIuJM3sUOWfKI=; b=keiU5G5AWLBNJsAwJvbIpRByjlfowPetTs+ewYyzxjbK9iH1rfWTe2Og76O7h6Tc2b kMN2NGNI2gBpZbD1uMEi5zI/XkBtmw1ZDegZfJQy1wPH0otczncGvuuTT9glIHxTlHrT md30iNQCrRmgKd4pgFby1I5jtAFId62l8V2fQ= 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=MI9Pri5ZPTaghx1rn22lpK9ksOlRXxZIuJM3sUOWfKI=; b=nlGAR2xQ3wqBW6lvpLvEluZLrfOb9nExMjmVuU8nmIw1s+hpFEutYrCTbq18IF4JJM ilIy4Wz0QmXeVC382K4rFUNDlFt1MWoVha+7cZI3SDLLjfN/afvk9rOpfhwk/OpQ4QLR 8/Sit3G947QMC61jKGEp2FvTo0dVRFNQtDxW0VhVGZYfSJrJxUqq25e+iUDvVt3ahE0V hFqytBIF4Kvxb6qtCaDAmcXv90b1w8mRs+RmGTg3hRUMy+lJ7v047ncsCRA4ebxJQzz9 USAauQzmd2yXai4qFlturG3vu0zfaeTj3F57qpXZrMpdTIUs73mvEdtbXnbSCTv3PcOC NJcw== X-Gm-Message-State: AA+aEWYvLEjPxuZ4Mo1JanJkm41/v8Pcpi10tzZ/tnvrQ9+BlCDmMxpv RK+d/S7QgAMtj3GoiIb2J2ieqbOTAL4= X-Received: by 2002:a63:ff62:: with SMTP id s34mr32136752pgk.325.1543383526142; Tue, 27 Nov 2018 21:38:46 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-170-180.tukw.qwest.net. [97.113.170.180]) by smtp.gmail.com with ESMTPSA id 19sm8569336pfs.108.2018.11.27.21.38.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Nov 2018 21:38:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 27 Nov 2018 21:38:30 -0800 Message-Id: <20181128053834.10861-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181128053834.10861-1-richard.henderson@linaro.org> References: <20181128053834.10861-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::543 Subject: [Qemu-devel] [PATCH 08/12] 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: cota@braap.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. 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 27d081e11a..82f9a66d31 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2458,47 +2458,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; } } } @@ -2602,43 +2601,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; }