From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Christopher Li <sparse@chrisli.org>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH] remove unused arg in uses/defs functions
Date: Thu, 8 Dec 2016 04:46:18 +0100 [thread overview]
Message-ID: <20161208034618.7910-1-luc.vanoostenryck@gmail.com> (raw)
In the liveness analysis, the use/def methods have a
'struct instruction *' argument.
This arg is never used and it's not clear for what it
could be used, what it would represent.
This patch remove this argument from all the concerned
functions.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
liveness.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/liveness.c b/liveness.c
index fb696720..2e513943 100644
--- a/liveness.c
+++ b/liveness.c
@@ -13,7 +13,7 @@
#include "flow.h"
static void phi_defines(struct instruction * phi_node, pseudo_t target,
- void (*defines)(struct basic_block *, struct instruction *, pseudo_t))
+ void (*defines)(struct basic_block *, pseudo_t))
{
pseudo_t phi;
FOR_EACH_PTR(phi_node->phi_list, phi) {
@@ -23,33 +23,33 @@ static void phi_defines(struct instruction * phi_node, pseudo_t target,
def = phi->def;
if (!def || !def->bb)
continue;
- defines(def->bb, phi->def, target);
+ defines(def->bb, target);
} END_FOR_EACH_PTR(phi);
}
static void asm_liveness(struct basic_block *bb, struct instruction *insn,
- void (*def)(struct basic_block *, struct instruction *, pseudo_t),
- void (*use)(struct basic_block *, struct instruction *, pseudo_t))
+ void (*def)(struct basic_block *, pseudo_t),
+ void (*use)(struct basic_block *, pseudo_t))
{
struct asm_constraint *entry;
FOR_EACH_PTR(insn->asm_rules->inputs, entry) {
- use(bb, insn, entry->pseudo);
+ use(bb, entry->pseudo);
} END_FOR_EACH_PTR(entry);
FOR_EACH_PTR(insn->asm_rules->outputs, entry) {
- def(bb, insn, entry->pseudo);
+ def(bb, entry->pseudo);
} END_FOR_EACH_PTR(entry);
}
static void track_instruction_usage(struct basic_block *bb, struct instruction *insn,
- void (*def)(struct basic_block *, struct instruction *, pseudo_t),
- void (*use)(struct basic_block *, struct instruction *, pseudo_t))
+ void (*def)(struct basic_block *, pseudo_t),
+ void (*use)(struct basic_block *, pseudo_t))
{
pseudo_t pseudo;
- #define USES(x) use(bb, insn, insn->x)
- #define DEFINES(x) def(bb, insn, insn->x)
+ #define USES(x) use(bb, insn->x)
+ #define DEFINES(x) def(bb, insn->x)
switch (insn->opcode) {
case OP_RET:
@@ -122,7 +122,7 @@ static void track_instruction_usage(struct basic_block *bb, struct instruction *
if (insn->target != VOID)
DEFINES(target);
FOR_EACH_PTR(insn->arguments, pseudo) {
- use(bb, insn, pseudo);
+ use(bb, pseudo);
} END_FOR_EACH_PTR(pseudo);
break;
@@ -180,7 +180,7 @@ static inline int trackable_pseudo(pseudo_t pseudo)
return pseudo && (pseudo->type == PSEUDO_REG || pseudo->type == PSEUDO_ARG);
}
-static void insn_uses(struct basic_block *bb, struct instruction *insn, pseudo_t pseudo)
+static void insn_uses(struct basic_block *bb, pseudo_t pseudo)
{
if (trackable_pseudo(pseudo)) {
struct instruction *def = pseudo->def;
@@ -189,7 +189,7 @@ static void insn_uses(struct basic_block *bb, struct instruction *insn, pseudo_t
}
}
-static void insn_defines(struct basic_block *bb, struct instruction *insn, pseudo_t pseudo)
+static void insn_defines(struct basic_block *bb, pseudo_t pseudo)
{
assert(trackable_pseudo(pseudo));
add_pseudo(&bb->defines, pseudo);
@@ -300,11 +300,11 @@ static void track_bb_phi_uses(struct basic_block *bb)
static struct pseudo_list **live_list;
static struct pseudo_list *dead_list;
-static void death_def(struct basic_block *bb, struct instruction *insn, pseudo_t pseudo)
+static void death_def(struct basic_block *bb, pseudo_t pseudo)
{
}
-static void death_use(struct basic_block *bb, struct instruction *insn, pseudo_t pseudo)
+static void death_use(struct basic_block *bb, pseudo_t pseudo)
{
if (trackable_pseudo(pseudo) && !pseudo_in_list(*live_list, pseudo)) {
add_pseudo(&dead_list, pseudo);
--
2.10.2
reply other threads:[~2016-12-08 4:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20161208034618.7910-1-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).