Thanyathip Somboon has been working in the recruitment and marketing industries since 2019. Thanyathip began their career as a Marketing role at Riverpark Consultant Company Limited, and is currently working as a Recruitment Consultant at GetLinks since 2022.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "util.h"
#include "symbol.h"
#include "temp.h"
#include "tree.h"
#include "absyn.h"
#include "assem.h"
#include "frame.h"
#include "graph.h"
#include "liveness.h"
#include "color.h"
#include "regalloc.h"
#include "table.h"
static void enterLiveMap(G_node flowNode, G_table t, Temp_tempList temps) {
G_enter(t, flowNode, temps);
}
static Temp_tempList lookupLiveMap(G_table t, G_node flowNode) {
return (Temp_tempList)G_look(t, flowNode);
}
static void showLiveMap(FILE *out, G_table t) {
G_show(out, t, (void(*)(FILE *, void *))Temp_printList);
}
static void build(G_graph flow, G_table t) {
G_nodeList nodes = G_nodes(flow);
G_nodeList worklist = nodes;
while(worklist) {
G_node n = worklist->head;
Temp_tempList in = lookupLiveMap(t, n);
Temp_tempList out = in;
G_nodeList succ = G_succ(n);
for(; succ; succ = succ->tail) {
Temp_tempList tl = lookupLiveMap(t, succ->head);
out = Temp_union(out, tl);
}
if(!Temp_equal(in, out)) {
enterLiveMap(n, t, out);
worklist = G_union(G_succ(n), worklist);
}
worklist = worklist->tail;
}
}
Sign up to view 0 direct reports
Get started