diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-12-19 15:18:07 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-09-05 13:34:08 +0200 |
commit | e25db16860b21e1065a7890e308c9236dfbc9a63 (patch) | |
tree | 402df2e9278766aa3a9a654a6eb4ade4f81df9c4 | |
parent | cedc66458dddf88ccd18971518a3772c8d755de6 (diff) | |
download | sparse-e25db16860b21e1065a7890e308c9236dfbc9a63.tar.gz |
use replace_with_value()
Replace existing 'replace_with_pseudo(insn, value_pseudo($N))'
by 'replace_with_value($N)'.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | simplify.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -838,7 +838,7 @@ static int simplify_shift(struct instruction *insn, pseudo_t pseudo, long long v omask = def->src2->value; nmask = omask & mask; if (nmask == 0) - return replace_with_pseudo(insn, value_pseudo(0)); + return replace_with_value(insn, 0); if (nmask == mask) return replace_pseudo(insn, &insn->src1, def->src1); if (nbr_users(pseudo) > 1) @@ -874,7 +874,7 @@ static int simplify_shift(struct instruction *insn, pseudo_t pseudo, long long v omask = def->src2->value; nmask = omask & mask; if (nmask == 0) - return replace_with_pseudo(insn, value_pseudo(0)); + return replace_with_value(insn, 0); if (nmask == mask) return replace_pseudo(insn, &insn->src1, def->src1); // do not simplify into ((A << S) & (M << S)) @@ -912,7 +912,7 @@ new_value: return replace_pseudo(insn, &insn->src1, pseudo->def->src1); } zero: - return replace_with_pseudo(insn, value_pseudo(0)); + return replace_with_value(insn, 0); replace_mask: insn->opcode = OP_AND; insn->src2 = value_pseudo(mask); @@ -1104,7 +1104,7 @@ static int simplify_constant_rightside(struct instruction *insn) case OP_MODU: case OP_MODS: if (value == 1) - return replace_with_pseudo(insn, value_pseudo(0)); + return replace_with_value(insn, 0); return 0; case OP_DIVU: case OP_DIVS: @@ -1167,14 +1167,14 @@ static int simplify_binop_same_args(struct instruction *insn, pseudo_t arg) warning(insn->pos, "self-comparison always evaluates to false"); case OP_SUB: case OP_XOR: - return replace_with_pseudo(insn, value_pseudo(0)); + return replace_with_value(insn, 0); case OP_SET_EQ: case OP_SET_LE: case OP_SET_GE: case OP_SET_BE: case OP_SET_AE: if (Wtautological_compare) warning(insn->pos, "self-comparison always evaluates to true"); - return replace_with_pseudo(insn, value_pseudo(1)); + return replace_with_value(insn, 1); case OP_AND: case OP_OR: @@ -1298,7 +1298,7 @@ static int simplify_constant_unop(struct instruction *insn) mask = 1ULL << (insn->size-1); res &= mask | (mask-1); - replace_with_pseudo(insn, value_pseudo(res)); + replace_with_value(insn, res); return REPEAT_CSE; } @@ -1577,7 +1577,7 @@ static int simplify_select(struct instruction *insn) if (cond == src2 && is_zero(src1)) { kill_use(&insn->src1); kill_use(&insn->src3); - replace_with_pseudo(insn, value_pseudo(0)); + replace_with_value(insn, 0); return REPEAT_CSE; } return 0; |