From: "Jan Pokorný" <pokorny_jan@seznam.cz>
To: sparse@chrisli.org
Cc: linux-sparse@vger.kernel.org
Subject: [PATCH 2/2] better dealing with OP_PHISOURCE insn
Date: Sat, 09 Apr 2011 14:07:04 +0200 [thread overview]
Message-ID: <4DA04BE8.9060706@seznam.cz> (raw)
In-Reply-To: <4DA048C2.8060501@seznam.cz>
Remove checking for a case that (most probably) never happens as the
only expected instruction is OP_PHISOURCE.
For the sake of assurance, assert added with a comment easing the fix if
the assumption of OP_PHISOURCE is wrong (better then masking a problem).
Also, use `def' as existing shortcut for `phi->def'.
Tested the same way as the previous patch (together).
Signed-off-by: Jan Pokorny <pokorny_jan@seznam.cz>
---
liveness.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/liveness.c b/liveness.c
index eeff0f7..02ceed9 100644
--- a/liveness.c
+++ b/liveness.c
@@ -23,11 +23,9 @@ static void phi_defines(struct instruction * phi_node, pseudo_t target,
def = phi->def;
if (!def || !def->bb)
continue;
- if (def->opcode == OP_PHI) {
- phi_defines(def, target, defines);
- continue;
- }
- defines(def->bb, phi->def, target);
+ /* if this ever fails (very unlikely), it's a sign of a regression */
+ assert(def->opcode == OP_PHISOURCE);
+ defines(def->bb, def, target);
} END_FOR_EACH_PTR(phi);
}
--
1.7.1
next prev parent reply other threads:[~2011-04-09 12:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-09 11:53 [PATCH 1/2] better dealing with OP_PHISOURCE insn Jan Pokorný
2011-04-09 12:07 ` Jan Pokorný [this message]
2011-04-09 12:12 ` [PATCH 2/2] " Jan Pokorný
2011-04-14 10:10 ` Christopher Li
2011-04-15 22:52 ` Jan Pokorný
2011-04-16 10:56 ` Jan Pokorný
2011-04-16 11:16 ` Jan Pokorný
2011-04-16 14:49 ` Jan Pokorný
2011-04-16 16:21 ` Jan Pokorný
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DA04BE8.9060706@seznam.cz \
--to=pokorny_jan@seznam.cz \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.