diff options
Diffstat (limited to 'contrib/llvm/lib/CodeGen/MachineInstrBundle.cpp')
-rw-r--r-- | contrib/llvm/lib/CodeGen/MachineInstrBundle.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/llvm/lib/CodeGen/MachineInstrBundle.cpp b/contrib/llvm/lib/CodeGen/MachineInstrBundle.cpp index 962169e..0690f08 100644 --- a/contrib/llvm/lib/CodeGen/MachineInstrBundle.cpp +++ b/contrib/llvm/lib/CodeGen/MachineInstrBundle.cpp @@ -16,6 +16,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetRegisterInfo.h" +#include "llvm/Target/TargetSubtargetInfo.h" using namespace llvm; namespace { @@ -103,12 +104,12 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB, assert(FirstMI != LastMI && "Empty bundle?"); MIBundleBuilder Bundle(MBB, FirstMI, LastMI); - const TargetMachine &TM = MBB.getParent()->getTarget(); - const TargetInstrInfo *TII = TM.getInstrInfo(); - const TargetRegisterInfo *TRI = TM.getRegisterInfo(); + MachineFunction &MF = *MBB.getParent(); + const TargetInstrInfo *TII = MF.getSubtarget().getInstrInfo(); + const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo(); - MachineInstrBuilder MIB = BuildMI(*MBB.getParent(), FirstMI->getDebugLoc(), - TII->get(TargetOpcode::BUNDLE)); + MachineInstrBuilder MIB = + BuildMI(MF, FirstMI->getDebugLoc(), TII->get(TargetOpcode::BUNDLE)); Bundle.prepend(MIB); SmallVector<unsigned, 32> LocalDefs; @@ -140,7 +141,7 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB, // Internal def is now killed. KilledDefSet.insert(Reg); } else { - if (ExternUseSet.insert(Reg)) { + if (ExternUseSet.insert(Reg).second) { ExternUses.push_back(Reg); if (MO.isUndef()) UndefUseSet.insert(Reg); @@ -157,7 +158,7 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB, if (!Reg) continue; - if (LocalDefSet.insert(Reg)) { + if (LocalDefSet.insert(Reg).second) { LocalDefs.push_back(Reg); if (MO.isDead()) { DeadDefSet.insert(Reg); @@ -173,7 +174,7 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB, if (!MO.isDead()) { for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) { unsigned SubReg = *SubRegs; - if (LocalDefSet.insert(SubReg)) + if (LocalDefSet.insert(SubReg).second) LocalDefs.push_back(SubReg); } } @@ -185,7 +186,7 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB, SmallSet<unsigned, 32> Added; for (unsigned i = 0, e = LocalDefs.size(); i != e; ++i) { unsigned Reg = LocalDefs[i]; - if (Added.insert(Reg)) { + if (Added.insert(Reg).second) { // If it's not live beyond end of the bundle, mark it dead. bool isDead = DeadDefSet.count(Reg) || KilledDefSet.count(Reg); MIB.addReg(Reg, getDefRegState(true) | getDeadRegState(isDead) | |