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: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 4/5] asm-mem: does it output to memory?
Date: Sun, 21 Feb 2021 23:34:51 +0100	[thread overview]
Message-ID: <20210221223452.8075-5-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20210221223452.8075-1-luc.vanoostenryck@gmail.com>

If an asm statement have a memory output operand, it modifies memory.

Since this information is needed during memops simplification,
add this info directly in the corresponding instruction,
avoiding the need to scan the output operands list each time.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 linearize.c | 1 +
 linearize.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/linearize.c b/linearize.c
index 4140b60caebd..0c9b0e59cc4b 100644
--- a/linearize.c
+++ b/linearize.c
@@ -2153,6 +2153,7 @@ static void add_asm_output_address(struct entrypoint *ep, struct instruction *in
 
 	pseudo = linearize_expression(ep, op->expr);
 	add_asm_rule(insn, &insn->asm_rules->outputs, op, pseudo);
+	insn->output_memory = 1;
 }
 
 static void add_asm_output(struct entrypoint *ep, struct instruction *insn, struct asm_operand *op)
diff --git a/linearize.h b/linearize.h
index fb51327684bb..cf0cf066a8e5 100644
--- a/linearize.h
+++ b/linearize.h
@@ -151,6 +151,7 @@ struct instruction {
 			const char *string;
 			struct asm_rules *asm_rules;
 			int clobber_memory:1;
+			int output_memory:1;
 		};
 	};
 };
-- 
2.30.0


  parent reply	other threads:[~2021-02-21 22:35 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 ` Luc Van Oostenryck [this message]
2021-02-21 22:34 ` [PATCH 5/5] asm-mem: teach dominates() about OP_ASM 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=20210221223452.8075-5-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 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.