Skip to content

legacy::PRE::partialRedundancyEliminationOne

Do partial redundancy elimination, looking for copies of one expression expr within the basic block root. A control flow graph for root must be provided in cfg, with a map from nodes to their statements in node_statements, a map from edges to their CFG edge types in edge_type, and a map from edges to their insertion points in edge_insertion_point. The algorithm used is that of Paleri, Srikant, and Shankar ("Partial redundancy elimination: a simple, pragmatic, and provably correct algorithm", Science of Computer Programming 48 (2003) 1--20). Removed roots are appended to retired_expressions. The caller owns them until its expression worklist and equality scans have finished, then must delete them. Their former AST parents are cleared at replacement.

Synopsis

Declared in <src/midend/programTransformation/partialRedundancyElimination/pre.h>

void
partialRedundancyEliminationOne(
    SgExpression* expr,
    SgBasicBlock* root,
    myControlFlowGraph const& cfg,
    std::vector<SgExpression*>& retired_expressions);

Parameters

Name Description
expr This class represents the notion of an expression. Expressions
root This class represents the concept of a block (not a basic block from control flow analysis).
cfg The whole CFG structure, including some external properties
retired_expressions A standard container which offers fixed time access to individual elements in any order.

Created with MrDocs