
Classes | |
| class | ElimDead |
| class | RewriteTableKeys |
Public Member Functions | |
| DoLocalCopyPropagation (ReferenceMap *refMap, TypeMap *typeMap, std::function< bool(const Context *, const IR::Expression *)> policy, bool eut) | |
Local copy propagation and dead code elimination within a single pass. This pass is designed to be run after all declarations have received unique internal names. This is important because the locals map uses only the declaration name, and not the full path.
Requires that all declaration names be globally unique (obtained by running UniqueNames).
Requires that all variable declarations are at the top-level control scope (obtained using MoveDeclarations).
| policy |
This predicate function will be called for any expression that could be copy-propagated to determine if it should be. It will only be called for expressions that are legal to propagate (so no side effects, or dependencies that would change the meaning), so the policy should only evaluate the potential cost of propagating, as propagated expressions may be evaluated mulitple times. The default policy just returns true – always propagate if legal to do so.