|
CIRCT 23.0.0git
|
#include "circt/Dialect/RTG/IR/RTGAttributes.h"#include "circt/Dialect/RTG/IR/RTGISAAssemblyOpInterfaces.h"#include "circt/Dialect/RTG/IR/RTGOps.h"#include "circt/Dialect/RTG/Transforms/RTGPasses.h"#include "circt/Support/UnusedOpPruner.h"#include "llvm/Support/Debug.h"#include <variant>#include "circt/Dialect/RTG/Transforms/RTGPasses.h.inc"
Go to the source code of this file.
Namespaces | |
| namespace | circt |
| The InstanceGraph op interface, see InstanceGraphInterface.td for more details. | |
| namespace | circt::rtg |
Macros | |
| #define | GEN_PASS_DEF_LINEARSCANREGISTERALLOCATIONPASS |
| #define | DEBUG_TYPE "rtg-linear-scan-register-allocation" |
Functions | |
| static LogicalResult | foldAndEnqueueResults (Operation *user, Value current, Attribute currentAttr, SmallVectorImpl< std::pair< Value, Attribute > > &worklist, DenseMap< Value, Attribute > &visited) |
| Folds an operation and adds its results to the worklist. | |
| static RegisterAllocationResult | collectTransitiveRegisterAllocationOperands (Value value, rtg::RegisterAttrInterface reg, SetVector< std::pair< Value, rtg::RegisterAttrInterface > > &operands) |
| static void | expireOldInterval (SmallVector< FixedLiveRange > &active, const VirtualLiveRange &liveRange) |
| static bool | updateLiveRangeFromUsers (const LiveRangeCache &cache, Value value, LiveRange &liveRange) |
| Updates the live range based on users of a value. | |
| static VirtualLiveRange * | createRange (LiveRangeCache &cache, rtg::VirtualRegisterOp op) |
| Creates a live range for a virtual register operation. | |
| static LogicalResult | computeLiveRanges (LiveRangeCache &cache, Region ®ion) |
| Computes live ranges for all virtual registers and identifies reserved (fixed) registers. | |
| static RegisterAllocationResult | isRegisterAvailable (const LiveRangeCache &cache, ArrayRef< FixedLiveRange > active, rtg::VirtualRegisterOp virtualReg, rtg::RegisterAttrInterface reg, DenseMap< Value, rtg::RegisterAttrInterface > &dependentRegValues) |
| Checks if a specific register is available for allocation to a virtual register. | |
| static rtg::RegisterAttrInterface | findAvailableRegister (const LiveRangeCache &cache, ArrayRef< FixedLiveRange > active, VirtualLiveRange &liveRange, DenseMap< Value, rtg::RegisterAttrInterface > &dependentRegValues) |
| Finds an available register for the given virtual register from its allowed register set. | |
| static void | materializeAllocation (const LiveRangeCache &cache, const DenseMap< rtg::VirtualRegisterOp, rtg::RegisterAttrInterface > &assignedRegisters) |
| Replaces all virtual register operations with their allocated fixed registers and removes unused operations. | |
| static LogicalResult | allocateVirtualRegistersInCache (LiveRangeCache &cache) |
| Performs the main register allocation using linear scan algorithm. | |
| #define DEBUG_TYPE "rtg-linear-scan-register-allocation" |
Definition at line 32 of file LinearScanRegisterAllocationPass.cpp.
| #define GEN_PASS_DEF_LINEARSCANREGISTERALLOCATIONPASS |
Definition at line 24 of file LinearScanRegisterAllocationPass.cpp.
|
static |
Performs the main register allocation using linear scan algorithm.
Processes live ranges in order, expires old intervals, and assigns registers to virtual registers.
Definition at line 535 of file LinearScanRegisterAllocationPass.cpp.
References expireOldInterval(), findAvailableRegister(), and materializeAllocation().
|
static |
Definition at line 220 of file LinearScanRegisterAllocationPass.cpp.
References foldAndEnqueueResults().
Referenced by createRange(), and isRegisterAvailable().
|
static |
Computes live ranges for all virtual registers and identifies reserved (fixed) registers.
Definition at line 373 of file LinearScanRegisterAllocationPass.cpp.
References createRange().
|
static |
Creates a live range for a virtual register operation.
Returns nullptr if the virtual register has no users that implement RegisterAllocationOpInterface.
Definition at line 335 of file LinearScanRegisterAllocationPass.cpp.
References collectTransitiveRegisterAllocationOperands(), and updateLiveRangeFromUsers().
Referenced by computeLiveRanges().
|
static |
Definition at line 283 of file LinearScanRegisterAllocationPass.cpp.
Referenced by allocateVirtualRegistersInCache().
|
static |
Finds an available register for the given virtual register from its allowed register set.
Returns an empty RegisterAttrInterface on failure.
Definition at line 451 of file LinearScanRegisterAllocationPass.cpp.
References isRegisterAvailable().
Referenced by allocateVirtualRegistersInCache().
|
static |
Folds an operation and adds its results to the worklist.
Returns Available on success, or an error status on failure.
Definition at line 173 of file LinearScanRegisterAllocationPass.cpp.
Referenced by collectTransitiveRegisterAllocationOperands().
|
static |
Checks if a specific register is available for allocation to a virtual register.
Verifies the register is not reserved, not in use by active ranges, and satisfies all constraints.
Definition at line 418 of file LinearScanRegisterAllocationPass.cpp.
References collectTransitiveRegisterAllocationOperands().
Referenced by findAvailableRegister().
|
static |
Replaces all virtual register operations with their allocated fixed registers and removes unused operations.
Definition at line 503 of file LinearScanRegisterAllocationPass.cpp.
References circt::UnusedOpPruner::eraseNow().
Referenced by allocateVirtualRegistersInCache().
|
static |
Updates the live range based on users of a value.
Returns true if any RegisterAllocationOpInterface users were found.
Definition at line 314 of file LinearScanRegisterAllocationPass.cpp.
Referenced by createRange().