#include "llvm/CodeGen/DetectDeadLanes.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
usingnamespacellvm;
#define DEBUG_TYPE …
DeadLaneDetector::DeadLaneDetector(const MachineRegisterInfo *MRI,
const TargetRegisterInfo *TRI)
: … { … }
static bool lowersToCopies(const MachineInstr &MI) { … }
static bool isCrossCopy(const MachineRegisterInfo &MRI,
const MachineInstr &MI,
const TargetRegisterClass *DstRC,
const MachineOperand &MO) { … }
void DeadLaneDetector::addUsedLanesOnOperand(const MachineOperand &MO,
LaneBitmask UsedLanes) { … }
void DeadLaneDetector::transferUsedLanesStep(const MachineInstr &MI,
LaneBitmask UsedLanes) { … }
LaneBitmask
DeadLaneDetector::transferUsedLanes(const MachineInstr &MI,
LaneBitmask UsedLanes,
const MachineOperand &MO) const { … }
void DeadLaneDetector::transferDefinedLanesStep(const MachineOperand &Use,
LaneBitmask DefinedLanes) { … }
LaneBitmask DeadLaneDetector::transferDefinedLanes(
const MachineOperand &Def, unsigned OpNum, LaneBitmask DefinedLanes) const { … }
LaneBitmask DeadLaneDetector::determineInitialDefinedLanes(unsigned Reg) { … }
LaneBitmask DeadLaneDetector::determineInitialUsedLanes(unsigned Reg) { … }
namespace {
class DetectDeadLanes : public MachineFunctionPass { … };
}
char DetectDeadLanes::ID = …;
char &llvm::DetectDeadLanesID = …;
INITIALIZE_PASS(…)
bool DetectDeadLanes::isUndefRegAtInput(
const MachineOperand &MO, const DeadLaneDetector::VRegInfo &RegInfo) const { … }
bool DetectDeadLanes::isUndefInput(const DeadLaneDetector &DLD,
const MachineOperand &MO,
bool *CrossCopy) const { … }
void DeadLaneDetector::computeSubRegisterLaneBitInfo() { … }
std::pair<bool, bool>
DetectDeadLanes::modifySubRegisterOperandStatus(const DeadLaneDetector &DLD,
MachineFunction &MF) { … }
bool DetectDeadLanes::runOnMachineFunction(MachineFunction &MF) { … }