#include "AMDGPU.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "SIRegisterInfo.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
usingnamespacellvm;
#define DEBUG_TYPE …
namespace {
class GCNRewritePartialRegUses : public MachineFunctionPass { … };
}
unsigned GCNRewritePartialRegUses::getSubReg(unsigned Offset,
unsigned Size) const { … }
unsigned GCNRewritePartialRegUses::shiftSubReg(unsigned SubReg,
unsigned RShift) const { … }
const uint32_t *
GCNRewritePartialRegUses::getSuperRegClassMask(const TargetRegisterClass *RC,
unsigned SubRegIdx) const { … }
const BitVector &GCNRewritePartialRegUses::getAllocatableAndAlignedRegClassMask(
unsigned AlignNumBits) const { … }
const TargetRegisterClass *
GCNRewritePartialRegUses::getRegClassWithShiftedSubregs(
const TargetRegisterClass *RC, unsigned RShift, unsigned RegNumBits,
unsigned CoverSubregIdx, SubRegMap &SubRegs) const { … }
const TargetRegisterClass *
GCNRewritePartialRegUses::getMinSizeReg(const TargetRegisterClass *RC,
SubRegMap &SubRegs) const { … }
void GCNRewritePartialRegUses::updateLiveIntervals(Register OldReg,
Register NewReg,
SubRegMap &SubRegs) const { … }
const TargetRegisterClass *
GCNRewritePartialRegUses::getOperandRegClass(MachineOperand &MO) const { … }
bool GCNRewritePartialRegUses::rewriteReg(Register Reg) const { … }
bool GCNRewritePartialRegUses::runOnMachineFunction(MachineFunction &MF) { … }
char GCNRewritePartialRegUses::ID;
char &llvm::GCNRewritePartialRegUsesID = …;
INITIALIZE_PASS_BEGIN(GCNRewritePartialRegUses, DEBUG_TYPE,
"Rewrite Partial Register Uses", false, false)
INITIALIZE_PASS_END(GCNRewritePartialRegUses, DEBUG_TYPE,
"Rewrite Partial Register Uses", false, false)