aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-22 17:08:06 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-22 17:15:32 +0100
commit4f10206cc4dcbe28d712a82497fc582585d4d2c7 (patch)
tree4114587473ce19aacd5c503825d1f8994e3e7498
parent80777740bcb17ee8aacb78ebd2dd9c0f84945474 (diff)
parent15bea3b0bbe7bab1d081aae9262e867366aff324 (diff)
downloadsparse-4f10206cc4dcbe28d712a82497fc582585d4d2c7.tar.gz
Merge branch 'cleanup' into next
-rw-r--r--flow.c3
-rw-r--r--flow.h1
-rw-r--r--simplify.c25
3 files changed, 8 insertions, 21 deletions
diff --git a/flow.c b/flow.c
index 162c2734..1a871df1 100644
--- a/flow.c
+++ b/flow.c
@@ -457,7 +457,6 @@ void convert_load_instruction(struct instruction *insn, pseudo_t src)
{
convert_instruction_target(insn, src);
kill_instruction(insn);
- repeat_phase |= REPEAT_SYMBOL_CLEANUP;
}
static int overlapping_memop(struct instruction *a, struct instruction *b)
@@ -559,7 +558,7 @@ complex_phi:
insn->phi_list = dominators;
end:
- repeat_phase |= REPEAT_SYMBOL_CLEANUP;
+ repeat_phase |= REPEAT_CSE;
}
/* Kill a pseudo that is dead on exit from the bb */
diff --git a/flow.h b/flow.h
index 19a743c8..c3461c8c 100644
--- a/flow.h
+++ b/flow.h
@@ -6,7 +6,6 @@
extern unsigned long bb_generation;
#define REPEAT_CSE (1 << 0)
-#define REPEAT_SYMBOL_CLEANUP (1 << 1)
#define REPEAT_CFG_CLEANUP (1 << 2)
struct entrypoint;
diff --git a/simplify.c b/simplify.c
index 2e002cec..e05ad8ac 100644
--- a/simplify.c
+++ b/simplify.c
@@ -259,8 +259,6 @@ out:
static inline void rem_usage(pseudo_t p, pseudo_t *usep, int kill)
{
if (has_use_list(p)) {
- if (p->type == PSEUDO_SYM)
- repeat_phase |= REPEAT_SYMBOL_CLEANUP;
delete_pseudo_user_list_entry(&p->users, usep, 1);
if (kill && !p->users)
kill_instruction(p->def);
@@ -326,25 +324,16 @@ int kill_insn(struct instruction *insn, int force)
case OP_UNOP ... OP_UNOP_END:
case OP_SLICE:
- kill_use(&insn->src1);
- break;
-
- case OP_PHI:
- kill_use_list(insn->phi_list);
- break;
case OP_PHISOURCE:
- kill_use(&insn->phi_src);
- break;
-
case OP_SYMADDR:
- kill_use(&insn->src);
- repeat_phase |= REPEAT_SYMBOL_CLEANUP;
- break;
-
case OP_CBR:
case OP_SWITCH:
case OP_COMPUTEDGOTO:
- kill_use(&insn->cond);
+ kill_use(&insn->src1);
+ break;
+
+ case OP_PHI:
+ kill_use_list(insn->phi_list);
break;
case OP_CALL:
@@ -1716,7 +1705,7 @@ static int simplify_one_memop(struct instruction *insn, pseudo_t orig)
if (def->opcode == OP_SYMADDR && def->src) {
kill_use(&insn->src);
use_pseudo(insn, def->src, &insn->src);
- return REPEAT_CSE | REPEAT_SYMBOL_CLEANUP;
+ return REPEAT_CSE;
}
if (def->opcode == OP_ADD) {
new = def->src1;
@@ -1752,7 +1741,7 @@ offset:
}
insn->offset += off->value;
replace_pseudo(insn, &insn->src, new);
- return REPEAT_CSE | REPEAT_SYMBOL_CLEANUP;
+ return REPEAT_CSE;
}
///