14#ifndef LLVM_CODEGEN_MACHINEINSTRBUNDLE_H
15#define LLVM_CODEGEN_MACHINEINSTRBUNDLE_H
46 while (
I->isBundledWithPred())
54 while (
I->isBundledWithPred())
62 while (
I->isBundledWithSucc())
71 while (
I->isBundledWithSucc())
93template <
typename ValueT>
96 std::forward_iterator_tag, ValueT> {
105 if (++InstrI == InstrE || !InstrI->isInsideBundle()) {
109 OpI = InstrI->operands_begin();
110 OpE = InstrI->operands_end();
122 InstrE =
MI.getParent()->instr_end();
123 OpI = InstrI->operands_begin();
124 OpE = InstrI->operands_end();
132 : InstrI(InstrE), InstrE(InstrE), OpI(OpE), OpE(OpE) {}
140 assert(
isValid() &&
"Cannot advance MIOperands beyond the last operand");
152 return InstrI == Arg.InstrI &&
153 (OpI == Arg.OpI || (OpI == OpE && Arg.OpI == Arg.OpE));
159 return OpI - InstrI->operands_begin();
204inline iterator_range<ConstMIBundleOperands>
246std::pair<LaneBitmask, LaneBitmask>
unsigned const MachineRegisterInfo * MRI
unsigned const TargetRegisterInfo * TRI
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ConstMIBundleOperands - Iterate over all operands in a const bundle of machine instructions.
static ConstMIBundleOperands end(const MachineBasicBlock &MBB)
Returns an iterator past the last iteration.
ConstMIBundleOperands(const MachineInstr &MI)
MIBundleOperandIteratorBase - Iterator that visits all operands in a bundle of MachineInstrs.
unsigned getOperandNo() const
getOperandNo - Returns the number of the current operand relative to its instruction.
MIBundleOperandIteratorBase(MachineInstr &MI)
MIBundleOperandIteratorBase - Create an iterator that visits all operands on MI, or all operands on e...
ValueT & operator*() const
MIBundleOperandIteratorBase(MachineBasicBlock::instr_iterator InstrE, MachineInstr::mop_iterator OpE)
Constructor for an iterator past the last iteration: both instruction iterators point to the end of t...
bool operator==(const MIBundleOperandIteratorBase &Arg) const
bool isValid() const
isValid - Returns true until all the operands have been visited.
ValueT * operator->() const
void operator++()
Preincrement. Move to the next operand.
MIBundleOperands - Iterate over all operands in a bundle of machine instructions.
static MIBundleOperands end(const MachineBasicBlock &MBB)
Returns an iterator past the last iteration.
MIBundleOperands(MachineInstr &MI)
Instructions::iterator instr_iterator
Instructions::const_iterator const_instr_iterator
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Wrapper class representing virtual and physical registers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
A range adaptor for a pair of iterators.
This is an optimization pass for GlobalISel generic memory operations.
void finalizeBundle(MachineBasicBlock &MBB, MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
finalizeBundle - Finalize a machine instruction bundle which includes a sequence of instructions star...
MachineBasicBlock::instr_iterator getBundleStart(MachineBasicBlock::instr_iterator I)
Returns an iterator to the first instruction in the bundle containing I.
bool finalizeBundles(MachineFunction &MF)
finalizeBundles - Finalize instruction bundles in the specified MachineFunction.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
PhysRegInfo AnalyzePhysRegInBundle(const MachineInstr &MI, Register Reg, const TargetRegisterInfo *TRI)
AnalyzePhysRegInBundle - Analyze how the current instruction or bundle uses a physical register.
MachineBasicBlock::instr_iterator getBundleEnd(MachineBasicBlock::instr_iterator I)
Returns an iterator pointing beyond the bundle containing I.
iterator_range< ConstMIBundleOperands > const_mi_bundle_ops(const MachineInstr &MI)
VirtRegInfo AnalyzeVirtRegInBundle(MachineInstr &MI, Register Reg, SmallVectorImpl< std::pair< MachineInstr *, unsigned > > *Ops=nullptr)
AnalyzeVirtRegInBundle - Analyze how the current instruction or bundle uses a virtual register.
iterator_range< MIBundleOperands > mi_bundle_ops(MachineInstr &MI)
std::pair< LaneBitmask, LaneBitmask > AnalyzeVirtRegLanesInBundle(const MachineInstr &MI, Register Reg, const MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI)
Return a pair of lane masks (reads, writes) indicating which lanes this instruction uses with Reg.
Information about how a physical register Reg is used by a set of operands.
bool Read
Reg or one of its aliases is read.
bool Defined
Reg or one of its aliases is defined.
bool Killed
There is a use operand of reg or a super-register with kill flag set.
bool PartialDeadDef
Reg is Defined and all defs of reg or an overlapping register are dead.
bool Clobbered
There is a regmask operand indicating Reg is clobbered.
bool FullyRead
Reg or a super-register is read. The full register is read.
bool FullyDefined
Reg or a super-register is defined.
VirtRegInfo - Information about a virtual register used by a set of operands.
bool Reads
Reads - One of the operands read the virtual register.
bool Tied
Tied - Uses and defs must use the same register.
bool Writes
Writes - One of the operands writes the virtual register.