From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Li Subject: [PATCH 4] Update usage chain for dead instruction Date: Tue, 16 Jan 2007 18:37:17 -0800 Message-ID: <20070117023717.GD962@chrisli.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from sccrmhc15.comcast.net ([204.127.200.85]:52312 "EHLO sccrmhc15.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751830AbXAQDAp (ORCPT ); Tue, 16 Jan 2007 22:00:45 -0500 Content-Disposition: inline Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: linux-sparse@vger.kernel.org Cc: Josh Triplett This patch address some of the dead instruction left in the usage chain. Signed-Off-By: Christopher Li Index: sparse/flow.c =================================================================== --- sparse.orig/flow.c 2006-12-21 14:35:18.000000000 -0800 +++ sparse/flow.c 2006-12-21 14:35:55.000000000 -0800 @@ -195,6 +195,7 @@ try_to_rewrite_target: if (bb_list_size(target->parents) != 1) return retval; insert_branch(target, insn, final); + kill_instruction(insn); return 1; } Index: sparse/simplify.c =================================================================== --- sparse.orig/simplify.c 2006-12-21 14:35:18.000000000 -0800 +++ sparse/simplify.c 2006-12-21 14:35:55.000000000 -0800 @@ -217,6 +217,11 @@ void kill_instruction(struct instruction kill_use(&insn->src2); kill_use(&insn->src3); return; + case OP_BR: + insn->bb = NULL; + repeat_phase |= REPEAT_CSE; + if (insn->cond) + kill_use(&insn->cond); } }