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 5/5] asm-mem: teach dominates() about OP_ASM
Date: Sun, 21 Feb 2021 23:34:52 +0100	[thread overview]
Message-ID: <20210221223452.8075-6-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20210221223452.8075-1-luc.vanoostenryck@gmail.com>

The function dominates() needs to know if an OP_ASM instruction
may modify.

Use the information now available in the instruction to return
the answer.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 flow.c                           | 6 ++++++
 validation/mem2reg/asm-reload0.c | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/flow.c b/flow.c
index 5751ce756518..5d63018798d6 100644
--- a/flow.c
+++ b/flow.c
@@ -495,6 +495,12 @@ int dominates(pseudo_t pseudo, struct instruction *insn, struct instruction *dom
 		return local ? 0 : -1;
 	case OP_LOAD: case OP_STORE:
 		break;
+	case OP_ASM:
+		if (dom->clobber_memory)
+			return -1;
+		if (dom->output_memory)
+			return -1;
+		return 0;
 	default:
 		return 0;
 	}
diff --git a/validation/mem2reg/asm-reload0.c b/validation/mem2reg/asm-reload0.c
index c9e297dde428..ce1829e02724 100644
--- a/validation/mem2reg/asm-reload0.c
+++ b/validation/mem2reg/asm-reload0.c
@@ -8,7 +8,6 @@ static int asm_reload(void)
 /*
  * check-name: asm-reload0
  * check-command: test-linearize $file
- * check-known-to-fail
  *
  * check-output-ignore
  * check-output-contains: load\\.
-- 
2.30.0


      parent reply	other threads:[~2021-02-21 22:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21 22:34 [PATCH 0/5] teach memory simplification about ASM instructions Luc Van Oostenryck
2021-02-21 22:34 ` [PATCH 1/5] reorg dominates() Luc Van Oostenryck
2021-02-21 22:34 ` [PATCH 2/5] asm-mem: add testcase for missing reload after asm memops Luc Van Oostenryck
2021-02-21 22:34 ` [PATCH 3/5] asm-mem: does it clobber memory? Luc Van Oostenryck
2021-02-21 22:34 ` [PATCH 4/5] asm-mem: does it output to memory? Luc Van Oostenryck
2021-02-21 22:34 ` 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=20210221223452.8075-6-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).