|
LLVM 23.0.0git
|
When rematerializating a register (called the "root" register in this context) to a given position, we must decide what to do with all its rematerializable dependencies (for unrematerializable dependencies, we have no choice but to re-use the same register). More...
#include "llvm/CodeGen/Rematerializer.h"
Public Member Functions | |
| DependencyReuseInfo & | reuse (RegisterIdx DepIdx) |
| DependencyReuseInfo & | useRemat (RegisterIdx DepIdx, RegisterIdx DepRematIdx) |
| DependencyReuseInfo & | clear () |
Public Attributes | |
| SmallDenseMap< RegisterIdx, RegisterIdx, 4 > | DependencyMap |
| Keys and values are rematerializable register indices. | |
When rematerializating a register (called the "root" register in this context) to a given position, we must decide what to do with all its rematerializable dependencies (for unrematerializable dependencies, we have no choice but to re-use the same register).
For each rematerializable dependency we can either
This struct allows to encode decisions of types (2) and (3) when rematerialization of all of the root's dependency DAG is undesirable. During rematerialization, registers in the root's dependency DAG which have a path to the root made up exclusively of non-re-used registers will be rematerialized along with the root.
Definition at line 264 of file Rematerializer.h.
|
inline |
Definition at line 292 of file Rematerializer.h.
References DependencyMap.
|
inline |
Definition at line 284 of file Rematerializer.h.
References DependencyMap.
|
inline |
Definition at line 288 of file Rematerializer.h.
References DependencyMap.
| SmallDenseMap<RegisterIdx, RegisterIdx, 4> llvm::Rematerializer::DependencyReuseInfo::DependencyMap |
Keys and values are rematerializable register indices.
Before rematerialization, this only contains entries for non-root registers of the root's dependency DAG which should not be rematerialized i.e., for which an existing register should be used instead. These map each such non-root register to either the same register (case 2, DependencyReuseInfo::reuse) or to a rematerialization of the key register (case 3, DependencyReuseInfo::useRemat).
After rematerialization, this contains additional entries for non-root registers of the root's dependency DAG that needed to be rematerialized along the root. These map each such non-root register to their corresponding new rematerialization that is used in the rematerialized root's dependency DAG. It follows that the difference in map size before and after rematerialization indicates the number of non-root registers that were rematerialized along the root.
Definition at line 282 of file Rematerializer.h.
Referenced by clear(), llvm::Rematerializer::rematerializeToPos(), reuse(), and useRemat().