|
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 82 of file CommonNodeElimination.cpp.
Definition at line 113 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 222 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 255 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 207 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 177 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 150 of file CommonNodeElimination.cpp.
|
inline |
Checks if the given output is associated with a congruence set.
| output | the output |
Definition at line 164 of file CommonNodeElimination.cpp.
|
inline |
Definition at line 122 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 134 of file CommonNodeElimination.cpp.
|
private |
Definition at line 265 of file CommonNodeElimination.cpp.
|
staticconstexpr |
Definition at line 114 of file CommonNodeElimination.cpp.
|
private |
Definition at line 263 of file CommonNodeElimination.cpp.