[PATCH 4/6] extract cse_eliminate() from cleanup_and_cse()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently, the same function doing the CSE's elimination phase
also contains the inner part of the optimization loop.

Moving the CSE elimination part in a seperate function will
allow to make a clear interface for CSE and move this inner
optimization loop out of the CSE file.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 cse.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/cse.c b/cse.c
index 42a6493d4..6469359f1 100644
--- a/cse.c
+++ b/cse.c
@@ -381,16 +381,10 @@ static struct instruction * try_to_cse(struct entrypoint *ep, struct instruction
 	return i1;
 }
 
-void cleanup_and_cse(struct entrypoint *ep)
+static void cse_eliminate(struct entrypoint *ep)
 {
 	int i;
 
-	simplify_memops(ep);
-repeat:
-	repeat_phase = 0;
-	clean_up_insns(ep);
-	if (repeat_phase & REPEAT_CFG_CLEANUP)
-		kill_unreachable_bbs(ep);
 	for (i = 0; i < INSN_HASH_SIZE; i++) {
 		struct instruction_list **list = insn_hash_table + i;
 		if (*list) {
@@ -413,6 +407,18 @@ repeat:
 			free_ptr_list((struct ptr_list **)list);
 		}
 	}
+}
+
+void cleanup_and_cse(struct entrypoint *ep)
+{
+	simplify_memops(ep);
+repeat:
+	repeat_phase = 0;
+	clean_up_insns(ep);
+	if (repeat_phase & REPEAT_CFG_CLEANUP)
+		kill_unreachable_bbs(ep);
+
+	cse_eliminate(ep);
 
 	if (repeat_phase & REPEAT_SYMBOL_CLEANUP)
 		simplify_memops(ep);
-- 
2.16.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux