[PATCH 2/3] use replace_with_value()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Replace existing 'replace_with_pseudo(insn, value_pseudo($N))'
by 'replace_with_value($N)'.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 simplify.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/simplify.c b/simplify.c
index 0c75b3fadcab..3c4b972ce607 100644
--- a/simplify.c
+++ b/simplify.c
@@ -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;
-- 
2.28.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux