All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Li <sparse@chrisli.org>
To: linux-sparse@vger.kernel.org
Cc: Linus Torvalds <torvalds@osdl.org>,
	Josh Triplett <josh@freedesktop.org>,
	Dan Carpenter <error27@gmail.com>
Subject: [RFC] [PATCH 2/4] remove dead branch usage
Date: Thu, 28 Dec 2006 01:25:40 -0800	[thread overview]
Message-ID: <20061228092540.GC6573@chrisli.org> (raw)

Fix some problem cause by dead branch instruction left in the user chain.

Signed-off-by: Christopher Li <sparse@chrisli.org>

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);
 	}
 }
 

                 reply	other threads:[~2006-12-28  9:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061228092540.GC6573@chrisli.org \
    --to=sparse@chrisli.org \
    --cc=error27@gmail.com \
    --cc=josh@freedesktop.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.