All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Christopher Li <sparse@chrisli.org>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 05/16] fix clear_phi(), replace it by kill_instruction()
Date: Thu, 16 Feb 2017 05:56:57 +0100	[thread overview]
Message-ID: <20170216045708.50661-6-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20170216045708.50661-1-luc.vanoostenryck@gmail.com>

clear_phi() only replaces a phi-node's sources by VOID
without adjusting the usage of these sources.
As such it can't be used for cleaning things before
removing an OP_PHI.

Fix this by replacing calls to clear_phi() by calls
to kill_instruction().

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 simplify.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/simplify.c b/simplify.c
index 17f1e2b61..ddd0aa9c5 100644
--- a/simplify.c
+++ b/simplify.c
@@ -110,7 +110,7 @@ static int if_convert_phi(struct instruction *insn)
 	 * the conditional branch too.
 	 */
 	insert_select(source, br, insn, p1, p2);
-	clear_phi(insn);
+	kill_instruction(insn);
 	return REPEAT_CSE;
 }
 
@@ -140,7 +140,7 @@ static int clean_up_phi(struct instruction *insn)
 	if (same) {
 		pseudo_t pseudo = last ? last->src1 : VOID;
 		convert_instruction_target(insn, pseudo);
-		clear_phi(insn);
+		kill_instruction(insn);
 		return REPEAT_CSE;
 	}
 
@@ -1142,7 +1142,7 @@ int simplify_instruction(struct instruction *insn)
 		return simplify_cast(insn);
 	case OP_PHI:
 		if (dead_insn(insn, NULL, NULL, NULL)) {
-			clear_phi(insn);
+			kill_use_list(insn->phi_list);
 			return REPEAT_CSE;
 		}
 		return clean_up_phi(insn);
-- 
2.11.0


  parent reply	other threads:[~2017-02-16  4:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16  4:56 [PATCH 00/16] instructions killing & operands usage Luc Van Oostenryck
2017-02-16  4:56 ` [PATCH 01/16] add killing of OP_SLICEs Luc Van Oostenryck
2017-02-16  4:56 ` [PATCH 02/16] add killing of OP_PHISOURCEs Luc Van Oostenryck
2017-02-16  4:56 ` [PATCH 03/16] add helper kill_use_list() Luc Van Oostenryck
2017-02-16  4:56 ` [PATCH 04/16] fix killing of OP_PHIs Luc Van Oostenryck
2017-02-16  4:56 ` Luc Van Oostenryck [this message]
2017-02-16  4:56 ` [PATCH 06/16] remove unused clear_phi() Luc Van Oostenryck
2017-02-16  4:56 ` [PATCH 07/16] fix killing of otherwise not-handled instructions Luc Van Oostenryck
2017-02-16  4:57 ` [PATCH 08/16] kill_instruction() may need to be forced or not Luc Van Oostenryck
2017-02-16  4:57 ` [PATCH 09/16] add killing of pure calls Luc Van Oostenryck
2017-02-16  4:57 ` [PATCH 10/16] fix killing OP_CALL via pointers Luc Van Oostenryck
2017-02-16  4:57 ` [PATCH 11/16] add killing of non-volatile loads Luc Van Oostenryck
2017-02-16  4:57 ` [PATCH 12/16] add killing of stores Luc Van Oostenryck
2017-02-16  4:57 ` [PATCH 13/16] fix killing of rewritten loads Luc Van Oostenryck
2017-02-16  4:57 ` [PATCH 14/16] use kill_instruction() when killing an OP_PHI during CSE Luc Van Oostenryck
2017-02-16  4:57 ` [PATCH 15/16] use kill_instruction() when killing any instructions " Luc Van Oostenryck
2017-02-16  4:57 ` [PATCH 16/16] fix OP_PHI usage in try_to_simplify_bb() Luc Van Oostenryck

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=20170216045708.50661-6-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.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.