ValueNumber.xcc

Benoit Dupont de Dinechin (Benoit.Dupont-de-Dinechin@st.com).

Copyright 2002 - 2007 STMicroelectronics. Copyright 1995 - 1998 Commissariat a l'Energie Atomique.

This program is free software; you can redistribute it and/or modify it under the terms of either (at your option): the GNU General Public License (GPL) version 2; the GNU Lesser General Public License (LGPL) version 2.1; any later version of these licences as published by the Free Software Foundation.

This module performs Value Numbering as it is described in the paper P. Briggs, K. Cooper and L. Simpson, "Value Numbering"

We are using dominator based value numberig here.

ValueNumber— Value numbering support.

TODO! This strcuture contains all necessary data for both dominator-based and scope-based Value Numbering. Once one of these is selected, the other one will be removed in other to save space.

Dominance based Value Numbering approach using unified hash table and dominators as suggested by Mon-Ping.

This approach uses unified hash table, but checks for dominance before deciding if one operation can replace another.

struct ValueNumber_;

ValueNumber_createNewScope() - creates new scope and puts it on top.

void
ValueNumber_createNewScope(ValueNumber this, BasicBlock block);

ValueNumber_removeScope() - removes current scope from the top.

void
ValueNumber_removeScope(ValueNumber this, BasicBlock block);

ValueNumber_getValueNumber() - Returns Value Number for this expression. Value Number is the name of the SSA variable, as described in Briggs et. al. "Value Numbering".

Returns: Value number - if equivalent operation exists in the hash table. NULL - if no equivalent operation was found. In this case expression is entered into the hash table.

Temporary
ValueNumber_getValueNumber(ValueNumber this, Operation operation);
ValueNumber_memory— This ValueNumber Memory.
Memory
ValueNumber_memory(ValueNumber this);
ValueNumber_codeRegion— This ValueNumber CodeRegion.
CodeRegion
ValueNumber_codeRegion(ValueNumber this);
ValueNumber_pretty— Pretty-print this ValueNumber.
bool
ValueNumber_pretty(ValueNumber this, FILE *file);