28 #define DEBUG_TYPE "postrapseudos" 62 "Post-RA pseudo instruction expansion pass",
false,
false)
73 CopyMI->addOperand(MO);
88 assert(SubIdx != 0 &&
"Invalid index for insert_subreg");
89 unsigned DstSubReg =
TRI->getSubReg(DstReg, SubIdx);
92 "Insert destination must be in a physical register");
94 "Inserted value must be in a physical register");
106 if (DstSubReg == InsReg) {
111 if (DstReg != InsReg) {
126 CopyMI->addRegisterDefined(DstReg);
148 if (IdentityCopy || SrcMO.
isUndef()) {
149 LLVM_DEBUG(
dbgs() << (IdentityCopy ?
"identity copy: " :
"undef copy: ")
170 TransferImplicitOperands(MI);
173 dbgs() <<
"replaced by: " << *(--dMI);
184 <<
"********** EXPANDING POST-RA PSEUDO INSTRS **********\n" 185 <<
"********** Function: " << MF.
getName() <<
'\n');
189 bool MadeChange =
false;
192 mbbi != mbbe; ++mbbi) {
211 case TargetOpcode::SUBREG_TO_REG:
212 MadeChange |= LowerSubregToReg(&MI);
214 case TargetOpcode::COPY:
215 MadeChange |= LowerCopy(&MI);
217 case TargetOpcode::DBG_VALUE:
219 case TargetOpcode::INSERT_SUBREG:
220 case TargetOpcode::EXTRACT_SUBREG:
This class represents lattice values for constants.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
char & MachineDominatorsID
MachineDominators - This pass is a machine dominators analysis pass.
unsigned getReg() const
getReg - Returns the register number.
unsigned getSubReg() const
unsigned const TargetRegisterInfo * TRI
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
char & MachineLoopInfoID
MachineLoopInfo - This pass is a loop analysis pass.
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
unsigned getNumOperands() const
Retuns the total number of operands.
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
bool expandPostRAPseudo(MachineInstr &MI) const override
This function is called for all pseudo instructions that remain after register allocation.
char & ExpandPostRAPseudosID
ExpandPostRAPseudos - This pass expands pseudo instructions after register allocation.
AnalysisUsage & addPreservedID(const void *ID)
virtual const TargetInstrInfo * getInstrInfo() const
bool allDefsAreDead() const
Return true if all the defs of this instruction are dead.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
TargetInstrInfo - Interface to description of machine instruction set.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
bool isPseudo(QueryType Type=IgnoreBundle) const
Return true if this is a pseudo instruction that doesn't correspond to a real machine instruction...
Represent the analysis usage information of a pass.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Iterator for intrusive lists based on ilist_node.
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
MachineOperand class - Representation of each machine instruction operand.
void setPreservesCFG()
This function should be called by the pass, iff they do not:
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
const MachineBasicBlock * getParent() const
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const override
Emit instructions to copy a pair of physical registers.
Representation of each machine instruction.
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void RemoveOperand(unsigned OpNo)
Erase an operand from an instruction, leaving it with one fewer operand than it started with...
INITIALIZE_PASS(ExpandPostRA, DEBUG_TYPE, "Post-RA pseudo instruction expansion pass", false, false) void ExpandPostRA
TransferImplicitOperands - MI is a pseudo-instruction, and the lowered replacement instructions immed...
const MachineOperand & getOperand(unsigned i) const