}
/// \brief Clear and initialize the LivePhysRegs set.
- void init(const TargetRegisterInfo *TRI) {
- assert(TRI && "Invalid TargetRegisterInfo pointer.");
- this->TRI = TRI;
+ void init(const TargetRegisterInfo &TRI) {
+ this->TRI = &TRI;
LiveRegs.clear();
- LiveRegs.setUniverse(TRI->getNumRegs());
+ LiveRegs.setUniverse(TRI.getNumRegs());
}
/// \brief Clears the LivePhysRegs set.
if (!UpdateLiveIns)
return;
- LiveRegs.init(TRI);
+ LiveRegs.init(*TRI);
LiveRegs.addLiveOutsNoPristines(MBB);
for (MachineInstr &MI : make_range(MBB.rbegin(), MBB.rend()))
LiveRegs.stepBackward(MI);
return;
// Collect this block's live out register units.
- LiveRegSet.init(TRI);
+ LiveRegSet.init(*TRI);
// We do not need to care about pristine registers as they are just preserved
// but not actually used in the function.
LiveRegSet.addLiveOutsNoPristines(*MBB);
// Initialize liveins to the first BB. These are potentiall redefined by
// predicated instructions.
- Redefs.init(TRI);
+ Redefs.init(*TRI);
Redefs.addLiveIns(CvtMBB);
Redefs.addLiveIns(NextMBB);
// Compute a set of registers which must not be killed by instructions in
// BB1: This is everything live-in to BB2.
- DontKill.init(TRI);
+ DontKill.init(*TRI);
DontKill.addLiveIns(NextMBB);
if (CvtMBB.pred_size() > 1) {
// Initialize liveins to the first BB. These are potentially redefined by
// predicated instructions.
- Redefs.init(TRI);
+ Redefs.init(*TRI);
Redefs.addLiveIns(CvtMBB);
Redefs.addLiveIns(NextMBB);
// - BB1 live-out regs need implicit uses before being redefined by BB2
// instructions. We start with BB1 live-ins so we have the live-out regs
// after tracking the BB1 instructions.
- Redefs.init(TRI);
+ Redefs.init(*TRI);
Redefs.addLiveIns(MBB1);
Redefs.addLiveIns(MBB2);
// Compute a set of registers which must not be killed by instructions in BB1:
// This is everything used+live in BB2 after the duplicated instructions. We
// can compute this set by simulating liveness backwards from the end of BB2.
- DontKill.init(TRI);
+ DontKill.init(*TRI);
for (const MachineInstr &MI : make_range(MBB2.rbegin(), ++DI2.getReverse()))
DontKill.stepBackward(MI);
// For all basic blocks in the function.
for (auto &MBB : MF) {
DEBUG(dbgs() << "****** BB " << MBB.getName() << " ******\n");
- LiveRegs.init(TRI);
+ LiveRegs.init(*TRI);
// FIXME: This should probably be addLiveOuts().
LiveRegs.addLiveOutsNoPristines(MBB);
bool HasStackMap = false;
MachineBasicBlock::const_iterator Before) {
// Initialize if we never queried in this block.
if (!LiveRegsValid) {
- LiveRegs.init(TRI);
+ LiveRegs.init(*TRI);
LiveRegs.addLiveOuts(MBB);
LiveRegPos = MBB.end();
LiveRegsValid = true;
const SystemZSubtarget &ST = F.getSubtarget<SystemZSubtarget>();
TII = ST.getInstrInfo();
TRI = ST.getRegisterInfo();
- LiveRegs.init(TRI);
+ LiveRegs.init(*TRI);
bool Changed = false;
for (auto &MBB : F)
TII = MF.getSubtarget<X86Subtarget>().getInstrInfo();
OptForSize = MF.getFunction()->optForSize();
MLI = &getAnalysis<MachineLoopInfo>();
- LiveRegs.init(&TII->getRegisterInfo());
+ LiveRegs.init(TII->getRegisterInfo());
DEBUG(dbgs() << "Start X86FixupBWInsts\n";);