diff mbox series

[1/6] memops: dominates()s first arg is redundant

Message ID 20210321170822.46854-2-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series memops: small cleanups | expand

Commit Message

Luc Van Oostenryck March 21, 2021, 5:08 p.m. UTC
The first argument of dominates(), 'pseudo', is simply the 'src'
pseudo of it's second argument, the load or store instruction.

It's thus not needed to give it in a separate argument.

So, remove this redundant argument, since it makes things
slightly clearer.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 flow.c   |  4 ++--
 flow.h   |  2 +-
 memops.c | 12 ++++++------
 3 files changed, 9 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/flow.c b/flow.c
index cb94fcf20834..c235c5e92c8a 100644
--- a/flow.c
+++ b/flow.c
@@ -423,7 +423,7 @@  static inline int distinct_symbols(pseudo_t a, pseudo_t b)
  *
  * Return 0 if it doesn't, and -1 if you don't know.
  */
-int dominates(pseudo_t pseudo, struct instruction *insn, struct instruction *dom, int local)
+int dominates(struct instruction *insn, struct instruction *dom, int local)
 {
 	switch (dom->opcode) {
 	case OP_CALL: case OP_ENTRY:
@@ -440,7 +440,7 @@  int dominates(pseudo_t pseudo, struct instruction *insn, struct instruction *dom
 		return 0;
 	}
 
-	if (dom->src != pseudo) {
+	if (dom->src != insn->src) {
 		if (local)
 			return 0;
 		/* We don't think two explicitly different symbols ever alias */
diff --git a/flow.h b/flow.h
index c489ebe03034..d578fa95061a 100644
--- a/flow.h
+++ b/flow.h
@@ -41,7 +41,7 @@  static inline int kill_instruction_force(struct instruction *insn)
 }
 
 void check_access(struct instruction *insn);
-int dominates(pseudo_t pseudo, struct instruction *insn, struct instruction *dom, int local);
+int dominates(struct instruction *insn, struct instruction *dom, int local);
 
 extern void vrfy_flow(struct entrypoint *ep);
 extern int pseudo_in_list(struct pseudo_list *list, pseudo_t pseudo);
diff --git a/memops.c b/memops.c
index ff54208e2d54..7d9e4d703ee3 100644
--- a/memops.c
+++ b/memops.c
@@ -58,7 +58,7 @@  end:
 	repeat_phase |= REPEAT_CSE;
 }
 
-static int find_dominating_parents(pseudo_t pseudo, struct instruction *insn,
+static int find_dominating_parents(struct instruction *insn,
 	struct basic_block *bb, unsigned long generation, struct pseudo_list **dominators,
 	int local)
 {
@@ -75,7 +75,7 @@  static int find_dominating_parents(pseudo_t pseudo, struct instruction *insn,
 				continue;
 			if (one == insn)
 				goto no_dominance;
-			dominance = dominates(pseudo, insn, one, local);
+			dominance = dominates(insn, one, local);
 			if (dominance < 0) {
 				if (one->opcode == OP_LOAD)
 					continue;
@@ -90,7 +90,7 @@  no_dominance:
 			continue;
 		parent->generation = generation;
 
-		if (!find_dominating_parents(pseudo, insn, parent, generation, dominators, local))
+		if (!find_dominating_parents(insn, parent, generation, dominators, local))
 			return 0;
 		continue;
 
@@ -160,7 +160,7 @@  static void simplify_loads(struct basic_block *bb)
 				int dominance;
 				if (!dom->bb)
 					continue;
-				dominance = dominates(pseudo, insn, dom, local);
+				dominance = dominates(insn, dom, local);
 				if (dominance) {
 					/* possible partial dominance? */
 					if (dominance < 0)  {
@@ -180,7 +180,7 @@  static void simplify_loads(struct basic_block *bb)
 			generation = ++bb_generation;
 			bb->generation = generation;
 			dominators = NULL;
-			if (find_dominating_parents(pseudo, insn, bb, generation, &dominators, local)) {
+			if (find_dominating_parents(insn, bb, generation, &dominators, local)) {
 				/* This happens with initial assignments to structures etc.. */
 				if (!dominators) {
 					if (local) {
@@ -226,7 +226,7 @@  static void kill_dominated_stores(struct basic_block *bb)
 				int dominance;
 				if (!dom->bb)
 					continue;
-				dominance = dominates(pseudo, insn, dom, local);
+				dominance = dominates(insn, dom, local);
 				if (dominance) {
 					/* possible partial dominance? */
 					if (dominance < 0)