* [PATCH] do not call simplify_instruction() if already removed
@ 2020-11-07 12:57 Luc Van Oostenryck
0 siblings, 0 replies; only message in thread
From: Luc Van Oostenryck @ 2020-11-07 12:57 UTC (permalink / raw)
To: linux-sparse; +Cc: Luc Van Oostenryck
simplify_instruction() is called on every instructions, even
those already removed. It's useless (and annoying when debugging).
So, filter out removed instructions before calling simplify_instruction().
Fixes: c5ba883e6ac47381f8112ed33f22a931a79ac517
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
optimize.c | 2 ++
simplify.c | 3 ---
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/optimize.c b/optimize.c
index 31d94e6158ef..bfab74c01b62 100644
--- a/optimize.c
+++ b/optimize.c
@@ -34,6 +34,8 @@ static void clean_up_insns(struct entrypoint *ep)
FOR_EACH_PTR(ep->bbs, bb) {
struct instruction *insn;
FOR_EACH_PTR(bb->insns, insn) {
+ if (!insn->bb)
+ continue;
repeat_phase |= simplify_instruction(insn);
if (!insn->bb)
continue;
diff --git a/simplify.c b/simplify.c
index f2aaa52de84b..ba63f28a3231 100644
--- a/simplify.c
+++ b/simplify.c
@@ -1916,9 +1916,6 @@ int simplify_instruction(struct instruction *insn)
unsigned flags;
int changed = 0;
- if (!insn->bb)
- return 0;
-
flags = opcode_table[insn->opcode].flags;
if (flags & OPF_TARGET) {
if (!has_users(insn->target))
--
2.29.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-11-07 12:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-07 12:57 [PATCH] do not call simplify_instruction() if already removed Luc Van Oostenryck
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).