LLVM 20.0.0git
|
#include "AllocationOrder.h"
#include "RegAllocEvictionAdvisor.h"
#include "RegAllocGreedy.h"
#include "llvm/Analysis/InteractiveModelRunner.h"
#include "llvm/Analysis/MLModelRunner.h"
#include "llvm/Analysis/TensorSpec.h"
#include "MLRegAllocEvictAdvisor.h"
#include "llvm/Analysis/ReleaseModeModelRunner.h"
#include "llvm/CodeGen/CalcSpillWeights.h"
#include "llvm/CodeGen/LiveRegMatrix.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/RegisterClassInfo.h"
#include "llvm/CodeGen/VirtRegMap.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/PassRegistry.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include <array>
#include <bitset>
#include <memory>
Go to the source code of this file.
Classes | |
class | llvm::RegAllocScoring |
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
#define | DEBUG_TYPE "ml-regalloc" |
#define | RA_EVICT_FEATURES_LIST(M) |
#define | RA_EVICT_FIRST_DEVELOPMENT_FEATURE(M) |
#define | RA_EVICT_REST_DEVELOPMENT_FEATURES(M) |
#define | DecisionName "index_to_evict" |
#define | _FEATURE_IDX_SIMPLE(_, name, __, ___) name |
#define | _FEATURE_IDX(A, B, C, D) _FEATURE_IDX_SIMPLE(A, B, C, D), |
#define | _RESET(TYPE, NAME, SHAPE, __) |
#define | _DECL_FEATURES(type, name, shape, _) TensorSpec::createSpec<type>(#name, shape), |
#define | SET(ID, TYPE, VAL) |
Typedefs | |
using | CompiledModelType = NoopSavedModelImpl |
Functions | |
FunctionPass * | llvm::createRegAllocScoringPass () |
When learning an eviction policy, extract score(reward) information, otherwise this does nothing. | |
INITIALIZE_PASS (RegAllocScoring, "regallocscoringpass", "Register Allocation Scoring Pass", false, false) namespace | |
Variables | |
static cl::opt< std::string > | InteractiveChannelBaseName ("regalloc-evict-interactive-channel-base", cl::Hidden, cl::desc("Base file path for the interactive mode. The incoming filename should " "have the name <regalloc-evict-interactive-channel-base>.in, while the " "outgoing name should be " "<regalloc-evict-interactive-channel-base>.out")) |
static cl::opt< unsigned > | MaxCascade ("mlregalloc-max-cascade", cl::Hidden, cl::desc("The maximum number of times a live range can be " "evicted before preventing it from being evicted"), cl::init(20)) |
static const bool | EnableDevelopmentFeatures = false |
cl::opt< unsigned > | llvm::EvictInterferenceCutoff |
#define _RESET | ( | TYPE, | |
NAME, | |||
SHAPE, | |||
__ | |||
) |
#define DEBUG_TYPE "ml-regalloc" |
Definition at line 48 of file MLRegAllocEvictAdvisor.cpp.
#define DecisionName "index_to_evict" |
#define RA_EVICT_FEATURES_LIST | ( | M | ) |
#define RA_EVICT_FIRST_DEVELOPMENT_FEATURE | ( | M | ) |
#define RA_EVICT_REST_DEVELOPMENT_FEATURES | ( | M | ) |
#define SET | ( | ID, | |
TYPE, | |||
VAL | |||
) |
using CompiledModelType = NoopSavedModelImpl |
Definition at line 55 of file MLRegAllocEvictAdvisor.cpp.
INITIALIZE_PASS | ( | RegAllocScoring | , |
"regallocscoringpass" | , | ||
"Register Allocation Scoring Pass" | , | ||
false | , | ||
false | |||
) |
The ML evictor (commonalities between release and development mode)
This just calls Evaluate on the Runner, but in the development mode case, if we're just capturing the log of the default advisor, it needs to call the latter instead, so we need to pass all the necessary parameters for it. In the development case, it will also log.
Load the features of the given VirtReg (allocated or not) at column Pos, but if that can't be evicted, return false instead.
Definition at line 132 of file MLRegAllocEvictAdvisor.cpp.
References _DECL_FEATURES, _FEATURE_IDX, _FEATURE_IDX_SIMPLE, _RESET, llvm::AnalysisUsage::addRequired(), llvm::append_range(), llvm::RegAllocEvictionAdvisor::canEvictHintInterference(), llvm::DecisionName, DecisionName, llvm::DecisionSpec, llvm::RegAllocEvictionAdvisorAnalysis::Development, llvm::Pass::doInitialization(), llvm::LLVMContext::emitError(), EnableDevelopmentFeatures, llvm::FeatureCount, llvm::RegAllocEvictionAdvisorAnalysis::getAdvisor(), llvm::RegAllocEvictionAdvisorAnalysis::getAnalysisUsage(), llvm::Function::getContext(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getName(), llvm::InputFeatures, InteractiveChannelBaseName, llvm::RegAllocEvictionAdvisorAnalysis::logRewardIfNeeded(), Loops, llvm::NumberOfInterferences, OS, llvm::PerLiveRangeShape, RA, RA_EVICT_FEATURES_LIST, RA_EVICT_FIRST_DEVELOPMENT_FEATURE, RA_EVICT_REST_DEVELOPMENT_FEATURES, llvm::RegAllocEvictionAdvisorAnalysis::Release, and llvm::RegAllocEvictionAdvisor::tryFindEvictionCandidate().
Definition at line 91 of file MLRegAllocEvictAdvisor.cpp.
Referenced by INITIALIZE_PASS().
|
static |
|
static |