Currently, the simplification of individual instructions is done at the beginnig of the function doing the hashing for CSE. Separate the two help a little bit to understand the code there and making any changes if needed. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- cse.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cse.c b/cse.c index 269f03ba6..42a6493d4 100644 --- a/cse.c +++ b/cse.c @@ -35,16 +35,10 @@ static int phi_compare(pseudo_t phi1, pseudo_t phi2) } -static void clean_up_one_instruction(struct basic_block *bb, struct instruction *insn) +static void cse_collect(struct instruction *insn) { unsigned long hash; - if (!insn->bb) - return; - assert(insn->bb == bb); - repeat_phase |= simplify_instruction(insn); - if (!insn->bb) - return; hash = (insn->opcode << 3) + (insn->size >> 3); switch (insn->opcode) { case OP_SEL: @@ -144,7 +138,11 @@ static void clean_up_insns(struct entrypoint *ep) FOR_EACH_PTR(ep->bbs, bb) { struct instruction *insn; FOR_EACH_PTR(bb->insns, insn) { - clean_up_one_instruction(bb, insn); + repeat_phase |= simplify_instruction(insn); + if (!insn->bb) + continue; + assert(insn->bb == bb); + cse_collect(insn); } END_FOR_EACH_PTR(insn); } END_FOR_EACH_PTR(bb); } -- 2.16.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