|
Jlm
|
Classes | |
| struct | CongruenceSet |
Public Types | |
| using | CongruenceSetIndex = size_t |
Public Member Functions | |
| CongruenceSetIndex | numCongruenceSets () const |
| CongruenceSetIndex | tryGetSetFor (const rvsdg::Output &output) const |
| CongruenceSetIndex | getSetFor (const rvsdg::Output &output) const |
| bool | hasSet (const rvsdg::Output &output) const |
| CongruenceSetIndex | getOrCreateSetForLeader (const rvsdg::Output &leader) |
| const rvsdg::Output & | getLeader (CongruenceSetIndex index) const |
| void | addFollower (CongruenceSetIndex index, const rvsdg::Output &follower) |
| const util::HashSet< const rvsdg::Output * > & | getFollowers (CongruenceSetIndex index) const |
Static Public Attributes | |
| static constexpr auto | NoCongruenceSetIndex = std::numeric_limits<CongruenceSetIndex>::max() |
Private Attributes | |
| std::vector< CongruenceSet > | sets_ |
| std::unordered_map< const rvsdg::Output *, CongruenceSetIndex > | congruenceSetMapping_ |
Class representing congruence sets over outputs. Different outputs can be grouped together into congruence sets, where all members of a set are considered identical.
One output per set is the leader, and the rest are followers. During analysis of loops, outputs can be speculatively placed in the same congruence set. Later passes can then quickly verify if a outputs does not belong, by comparing against only the congruence set leader.
Definition at line 76 of file CommonNodeElimination.cpp.
Definition at line 107 of file CommonNodeElimination.cpp.
|
inline |
Makes the given output a follower of the congruence set with the given index. If output already follows the congruence set, this is a no-op If output already follows a different congruence set, it is moved. output can not be the leader of a congruence set.
| index | the index of the congruence set to follow |
| follower | the output that should become a follower |
Definition at line 216 of file CommonNodeElimination.cpp.
|
inline |
Gets the set of followers in the congruence set with the given index.
| index | the index of the congruence set |
Definition at line 249 of file CommonNodeElimination.cpp.
|
inline |
Gets the leader of the congruence set with the given index.
| index | the index of the congruence set |
Definition at line 201 of file CommonNodeElimination.cpp.
|
inline |
Creates a new congruence set, in which the given leader becomes the leader. If leader already belongs to a congruence set as a follower, it is removed from that set. If leader is already a leader of a set, its index is returned, and this is a no-op.
| leader | the output that should lead a congruence set |
Definition at line 171 of file CommonNodeElimination.cpp.
|
inline |
Gets the index of the congruence set representing the given output.
| output | the output |
| std::logic_error | if the output does not belong to a congruence set |
Definition at line 144 of file CommonNodeElimination.cpp.
|
inline |
Checks if the given output is associated with a congruence set.
| output | the output |
Definition at line 158 of file CommonNodeElimination.cpp.
|
inline |
Definition at line 116 of file CommonNodeElimination.cpp.
|
inline |
Gets the index of the congruence set representing the given output, if it has one.
| output | the output |
Definition at line 128 of file CommonNodeElimination.cpp.
|
private |
Definition at line 259 of file CommonNodeElimination.cpp.
|
staticconstexpr |
Definition at line 108 of file CommonNodeElimination.cpp.
|
private |
Definition at line 257 of file CommonNodeElimination.cpp.