diff mbox series

[1/5] reorg dominates()

Message ID 20210221223452.8075-2-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series teach memory simplification about ASM instructions | expand

Commit Message

Luc Van Oostenryck Feb. 21, 2021, 10:34 p.m. UTC
To prepare the handling of OP_ASM instructions, reorganize the
opcode tests to use a switch.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 flow.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/flow.c b/flow.c
index bda277aa551b..5751ce756518 100644
--- a/flow.c
+++ b/flow.c
@@ -490,12 +490,15 @@  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;
+	default:
 		return 0;
+	}
+
 	if (dom->src != pseudo) {
 		if (local)
 			return 0;