17#define DEBUG_TYPE "lvl-gen"
30 int getVLIndex(
unsigned Opcode);
38int LVLGen::getVLIndex(
unsigned Opcode) {
50unsigned LVLGen::getVL(
const MachineInstr &
MI) {
51 int Index = getVLIndex(
MI.getOpcode());
53 return MI.getOperand(Index).getReg();
55 return VE::NoRegister;
58bool LVLGen::runOnMachineBasicBlock(MachineBasicBlock &
MBB) {
60 (MBB.getParent()->getSubtarget<VESubtarget>().getRegisterInfo()->getName(no))
63 bool HasRegForVL =
false;
75 unsigned Reg = getVL(*
MI);
76 if (
Reg != VE::NoRegister) {
81 << (HasRegForVL ?
RegName(RegForVL) :
"unknown")
84 if (!HasRegForVL || RegForVL !=
Reg) {
100 if (
MI->definesRegister(RegForVL,
TRI) ||
101 MI->modifiesRegister(RegForVL,
TRI) ||
102 MI->killsRegister(RegForVL,
TRI) ||
MI->isCall()) {
115bool LVLGen::runOnMachineFunction(MachineFunction &
F) {
122 const VESubtarget &Subtarget =
F.getSubtarget<VESubtarget>();
126 for (MachineBasicBlock &
MBB :
F)
const HexagonInstrInfo * TII
Register const TargetRegisterInfo * TRI
FunctionPass class - This class is used to implement most global optimizations.
Describe properties that are true of each instruction in the target description file.
MachineInstrBundleIterator< MachineInstr > iterator
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Representation of each machine instruction.
TargetInstrInfo - Interface to description of machine instruction set.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
const VEInstrInfo * getInstrInfo() const override
const VERegisterInfo * getRegisterInfo() const override
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
FunctionPass * createLVLGenPass()
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.