linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 2/2] simplify kill_insn() of unops and unop-ish instructions
Date: Sat, 21 Nov 2020 23:46:57 +0100	[thread overview]
Message-ID: <20201121224657.96038-3-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20201121224657.96038-1-luc.vanoostenryck@gmail.com>

In instructions, the first pseudo operands exist under different
names (.src1, .src, .cond, .phi_src) all aliased to each other.

Use this to simplify unops and others instructions with a single
pseudo operand.

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

diff --git a/simplify.c b/simplify.c
index 465624f72677..4508c6d54386 100644
--- a/simplify.c
+++ b/simplify.c
@@ -324,24 +324,16 @@ int kill_insn(struct instruction *insn, int force)
 
 	case OP_UNOP ... OP_UNOP_END:
 	case OP_SLICE:
-		kill_use(&insn->src1);
-		break;
-
-	case OP_PHI:
-		kill_use_list(insn->phi_list);
-		break;
 	case OP_PHISOURCE:
-		kill_use(&insn->phi_src);
-		break;
-
 	case OP_SYMADDR:
-		kill_use(&insn->src);
-		break;
-
 	case OP_CBR:
 	case OP_SWITCH:
 	case OP_COMPUTEDGOTO:
-		kill_use(&insn->cond);
+		kill_use(&insn->src1);
+		break;
+
+	case OP_PHI:
+		kill_use_list(insn->phi_list);
 		break;
 
 	case OP_CALL:
-- 
2.29.2


      parent reply	other threads:[~2020-11-21 22:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-21 22:46 [PATCH 0/2] cleanup REPEAT_SYMBOL_CLEANUP & kill_insn() Luc Van Oostenryck
2020-11-21 22:46 ` [PATCH 1/2] remove unneeded REPEAT_SYMBOL_CLEANUP Luc Van Oostenryck
2020-11-21 22:46 ` Luc Van Oostenryck [this message]

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=20201121224657.96038-3-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).