#include "llvm/CodeGen/LiveRegMatrix.h"
#include "RegisterCoalescer.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervalUnion.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/CodeGen/VirtRegMap.h"
#include "llvm/InitializePasses.h"
#include "llvm/MC/LaneBitmask.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
usingnamespacellvm;
#define DEBUG_TYPE …
STATISTIC(NumAssigned , "Number of registers assigned");
STATISTIC(NumUnassigned , "Number of registers unassigned");
char LiveRegMatrix::ID = …;
INITIALIZE_PASS_BEGIN(LiveRegMatrix, "liveregmatrix",
"Live Register Matrix", false, false)
INITIALIZE_PASS_DEPENDENCY(LiveIntervalsWrapperPass)
INITIALIZE_PASS_DEPENDENCY(VirtRegMap)
INITIALIZE_PASS_END(LiveRegMatrix, "liveregmatrix",
"Live Register Matrix", false, false)
LiveRegMatrix::LiveRegMatrix() : … { … }
void LiveRegMatrix::getAnalysisUsage(AnalysisUsage &AU) const { … }
bool LiveRegMatrix::runOnMachineFunction(MachineFunction &MF) { … }
void LiveRegMatrix::releaseMemory() { … }
template <typename Callable>
static bool foreachUnit(const TargetRegisterInfo *TRI,
const LiveInterval &VRegInterval, MCRegister PhysReg,
Callable Func) { … }
void LiveRegMatrix::assign(const LiveInterval &VirtReg, MCRegister PhysReg) { … }
void LiveRegMatrix::unassign(const LiveInterval &VirtReg) { … }
bool LiveRegMatrix::isPhysRegUsed(MCRegister PhysReg) const { … }
bool LiveRegMatrix::checkRegMaskInterference(const LiveInterval &VirtReg,
MCRegister PhysReg) { … }
bool LiveRegMatrix::checkRegUnitInterference(const LiveInterval &VirtReg,
MCRegister PhysReg) { … }
LiveIntervalUnion::Query &LiveRegMatrix::query(const LiveRange &LR,
MCRegister RegUnit) { … }
LiveRegMatrix::InterferenceKind
LiveRegMatrix::checkInterference(const LiveInterval &VirtReg,
MCRegister PhysReg) { … }
bool LiveRegMatrix::checkInterference(SlotIndex Start, SlotIndex End,
MCRegister PhysReg) { … }
Register LiveRegMatrix::getOneVReg(unsigned PhysReg) const { … }