diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-02-25 23:10:31 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-02-25 23:10:31 +0100 |
| commit | 3d617353dda682db8b3eb6ea8c1fdfa89edfe5e2 (patch) | |
| tree | 5b304807553a44b79ff430d838b1e1b9f72e10e7 /flow.c | |
| parent | 60c1f2706e30eacc29296e6cb5d9327c85a01340 (diff) | |
| parent | 2f92df710ef708c5e5fabb551189213e9ad5127e (diff) | |
| download | sparse-dev-3d617353dda682db8b3eb6ea8c1fdfa89edfe5e2.tar.gz | |
Merge branch 'asm-dom'
* asm: output *memory* operands need their address as *input*
* asm: teach dominates() about OP_ASM
Diffstat (limited to 'flow.c')
| -rw-r--r-- | flow.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -490,12 +490,21 @@ static inline int distinct_symbols(pseudo_t a, pseudo_t b) */ int dominates(pseudo_t pseudo, struct instruction *insn, struct instruction *dom, int local) { - int opcode = dom->opcode; - - if (opcode == OP_CALL || opcode == OP_ENTRY) + switch (dom->opcode) { + case OP_CALL: case OP_ENTRY: return local ? 0 : -1; - if (opcode != OP_LOAD && opcode != OP_STORE) + 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; + } + if (dom->src != pseudo) { if (local) return 0; |
