[PATCH 3/5] simpler guard in LSR-SHL simplification

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

 



For the simplification of ((x << S) > S), we can use the fact
there is a single PSEUDO_VAL for each value to simplifiy the
check guarding the simplification.

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

diff --git a/simplify.c b/simplify.c
index ef98b205a..0720070a8 100644
--- a/simplify.c
+++ b/simplify.c
@@ -673,9 +673,7 @@ static int simplify_shift(struct instruction *insn, pseudo_t pseudo, long long v
 		case OP_SHL:
 			// replace (A << S) >> S
 			// by      A & (Mask(size) >> S)
-			if (!constant(def->src2))
-				break;
-			if (def->src2->value != value)
+			if (def->src2 != insn->src2)
 				break;
 			size = insn->size - value;
 			insn->opcode = OP_AND;
-- 
2.18.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