36 "Unpack machine instruction bundles",
false,
false)
50 while (++
MII != MIE &&
MII->isBundledWithPred()) {
51 MII->unbundleFromPred();
52 for (
unsigned i = 0, e =
MII->getNumOperands(); i != e; ++i) {
87 "Finalize machine instruction bundles",
false,
false)
103 assert(FirstMI != LastMI &&
"Empty bundle?");
123 for (; FirstMI != LastMI; ++FirstMI) {
124 for (
unsigned i = 0, e = FirstMI->getNumOperands(); i != e; ++i) {
137 if (LocalDefSet.
count(Reg)) {
143 if (ExternUseSet.
insert(Reg)) {
154 for (
unsigned i = 0, e = Defs.
size(); i != e; ++i) {
160 if (LocalDefSet.
insert(Reg)) {
167 KilledDefSet.
erase(Reg);
170 DeadDefSet.
erase(Reg);
175 unsigned SubReg = *SubRegs;
176 if (LocalDefSet.
insert(SubReg))
186 for (
unsigned i = 0, e = LocalDefs.
size(); i != e; ++i) {
187 unsigned Reg = LocalDefs[i];
190 bool isDead = DeadDefSet.
count(Reg) || KilledDefSet.
count(Reg);
196 for (
unsigned i = 0, e = ExternUses.
size(); i != e; ++i) {
197 unsigned Reg = ExternUses[i];
198 bool isKill = KilledUseSet.
count(Reg);
199 bool isUndef = UndefUseSet.
count(Reg);
215 while (LastMI != E && LastMI->isInsideBundle())
224 bool Changed =
false;
231 assert(!MII->isInsideBundle() &&
232 "First instr cannot be inside bundle before finalization!");
234 for (++MII; MII != MIE; ) {
235 if (!MII->isInsideBundle())
283 bool AllDefsDead =
true;
284 PhysRegInfo PRI = {
false,
false,
false,
false,
false,
false};
287 "analyzePhysReg not given a physical register!");
297 unsigned MOReg = MO.
getReg();
301 bool IsRegOrSuperReg = MOReg == Reg || TRI->
isSubRegister(MOReg, Reg);
302 bool IsRegOrOverlapping = MOReg == Reg || TRI->
regsOverlap(MOReg, Reg);
304 if (IsRegOrSuperReg && MO.
readsReg()) {
310 if (IsRegOrOverlapping && MO.
readsReg()) {
317 if (IsRegOrSuperReg) {
322 if (IsRegOrOverlapping)
326 if (AllDefsDead && PRI.
Defines)
void push_back(const T &Elt)
const MachineFunction * getParent() const
bool isRegTiedToDefOperand(unsigned UseOpIdx, unsigned *DefOpIdx=0) const
INITIALIZE_PASS(UnpackMachineBundles,"unpack-mi-bundles","Unpack machine instruction bundles", false, false) bool UnpackMachineBundles
MachineInstr * getParent()
static PassRegistry * getPassRegistry()
instr_iterator instr_begin()
instr_iterator instr_end()
VirtRegInfo analyzeVirtReg(unsigned Reg, SmallVectorImpl< std::pair< MachineInstr *, unsigned > > *Ops=0)
bool isValid() const
isValid - returns true if this iterator is not yet at the end.
MachineOperand & deref() const
void initializeFinalizeMachineBundlesPass(PassRegistry &)
bool isSubRegister(unsigned RegA, unsigned RegB) const
Returns true if RegB is a sub-register of RegA.
void initializeUnpackMachineBundlesPass(PassRegistry &)
Instructions::iterator instr_iterator
bool DefinesDead
DefinesDead - All defs of a Reg or a super-register are dead.
const HexagonInstrInfo * TII
bool isReg() const
isReg - Tests if this is a MO_Register operand.
char & FinalizeMachineBundlesID
PhysRegInfo analyzePhysReg(unsigned Reg, const TargetRegisterInfo *TRI)
ID
LLVM Calling Convention Representation.
MIBundleBuilder & prepend(MachineInstr *MI)
unsigned getUndefRegState(bool B)
unsigned getKillRegState(bool B)
unsigned getDeadRegState(bool B)
unsigned getDefRegState(bool B)
bool Kills
There is a kill of Reg or a super-register.
bool regsOverlap(unsigned regA, unsigned regB) const
* if(!EatIfPresent(lltok::kw_thread_local)) return false
bool ReadsOverlap
ReadsOverlap - Reg or an overlapping register is read.
bool Writes
Writes - One of the operands writes the virtual register.
ItTy next(ItTy it, Dist n)
void setIsInternalRead(bool Val=true)
MachineInstrBuilder BuildMI(MachineFunction &MF, DebugLoc DL, const MCInstrDesc &MCID)
char & UnpackMachineBundlesID
UnpackMachineBundles - This pass unpack machine instruction bundles.
const MCInstrDesc & get(unsigned Opcode) const
bool isRegMask() const
isRegMask - Tests if this is a MO_RegisterMask operand.
virtual const TargetInstrInfo * getInstrInfo() const
bool finalizeBundles(MachineFunction &MF)
bool Reads
Reads - Read or a super-register is read.
static bool clobbersPhysReg(const uint32_t *RegMask, unsigned PhysReg)
bool count(const T &V) const
count - Return true if the element is in the set.
static bool isPhysicalRegister(unsigned Reg)
bool Defines
Defines - Reg or a super-register is defined.
unsigned getImplRegState(bool B)
const TargetMachine & getTarget() const
virtual const TargetRegisterInfo * getRegisterInfo() const
unsigned getReg() const
getReg - Returns the register number.
bool isValid() const
isValid - Returns true until all the operands have been visited.
BasicBlockListType::iterator iterator
ItTy prior(ItTy it, Dist n)
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
void finalizeBundle(MachineBasicBlock &MBB, MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
unsigned getOperandNo() const
bool isInternalRead() const