diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-02-20 10:08:06 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-02-21 14:45:08 +0100 |
commit | d6721b38b376e881b4aaf8a35eda4af45740245a (patch) | |
tree | 32377cc4c82577c0f2b1d5954f9e03e176acf5d0 | |
parent | 34c57a7f73e14095364a8863070f8e8c9f62cdc4 (diff) | |
download | sparse-d6721b38b376e881b4aaf8a35eda4af45740245a.tar.gz |
asm-mem: does it output to memory?
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>
-rw-r--r-- | linearize.c | 1 | ||||
-rw-r--r-- | linearize.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/linearize.c b/linearize.c index 4140b60c..0c9b0e59 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 fb513276..cf0cf066 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; }; }; }; |