No functional changes, just moving the core around in preparation for shift-shift simplification. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- simplify.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/simplify.c b/simplify.c index 9e4a496fd..911ab11a9 100644 --- a/simplify.c +++ b/simplify.c @@ -627,14 +627,19 @@ static int simplify_shift(struct instruction *insn, pseudo_t pseudo, long long v break; case OP_LSR: size = operand_size(insn, pseudo); - /* fall through */ + if (value >= size) + goto zero; + switch(DEF_OPCODE(def, pseudo)) { + case OP_LSR: + goto case_shift_shift; + } + break; case OP_SHL: if (value >= size) goto zero; - if (pseudo->type != PSEUDO_REG) - break; - def = pseudo->def; - if (def->opcode == insn->opcode) { + switch(DEF_OPCODE(def, pseudo)) { + case OP_SHL: + case_shift_shift: // also for LSR - lSR if (def == insn) // cyclic DAG! break; src2 = def->src2; -- 2.18.0 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html