Skip to content

Commit

Permalink
expose interface to CSE
Browse files Browse the repository at this point in the history
Now that the CSE have a well defined interface, we can
make it public, which will help us to untangle the CSE
part from the whole optimization logic.

Signed-off-by: Luc Van Oostenryck <[email protected]>
  • Loading branch information
lucvoo committed Feb 24, 2018
1 parent c6399dd commit 6114de4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cse.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "expression.h"
#include "linearize.h"
#include "flow.h"
#include "cse.h"

#define INSN_HASH_SIZE 256
static struct instruction_list *insn_hash_table[INSN_HASH_SIZE];
Expand All @@ -35,7 +36,7 @@ static int phi_compare(pseudo_t phi1, pseudo_t phi2)
}


static void cse_collect(struct instruction *insn)
void cse_collect(struct instruction *insn)
{
unsigned long hash;

Expand Down Expand Up @@ -381,7 +382,7 @@ static struct instruction * try_to_cse(struct entrypoint *ep, struct instruction
return i1;
}

static void cse_eliminate(struct entrypoint *ep)
void cse_eliminate(struct entrypoint *ep)
{
int i;

Expand Down
11 changes: 11 additions & 0 deletions cse.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef CSE_H
#define CSE_H

struct instruction;
struct entrypoint;

/* cse.c */
void cse_collect(struct instruction *insn);
void cse_eliminate(struct entrypoint *ep);

#endif

0 comments on commit 6114de4

Please sign in to comment.