|
|
@ -41,7 +41,7 @@ export const liveness = (block: BasicBlock): LivenessInfo => { |
|
|
|
continue |
|
|
|
} |
|
|
|
|
|
|
|
const labelSet = info[getLabelIndex(block, block.insns[i].dest as string)] |
|
|
|
const labelSet = info[block.labels[block.insns[i].dest as string]] |
|
|
|
if (setEquals(info[i], labelSet)) { |
|
|
|
continue |
|
|
|
} |
|
|
@ -54,19 +54,6 @@ export const liveness = (block: BasicBlock): LivenessInfo => { |
|
|
|
return info |
|
|
|
} |
|
|
|
|
|
|
|
export const getLabelIndex = (block: BasicBlock, label: string): number => { |
|
|
|
let idx = -1 |
|
|
|
|
|
|
|
for (let i = 0; i < block.insns.length; ++i) { |
|
|
|
if (block.insns[i].type === "label" && block.insns[i].dest === label) { |
|
|
|
idx = i |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return idx |
|
|
|
} |
|
|
|
|
|
|
|
export const interference = (block: BasicBlock, live: LivenessInfo): Graph<Loc> => |
|
|
|
createGraph((v, e) => { |
|
|
|
block.locs().forEach(loc => { |
|
|
|