summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-12-13 23:23:46 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-12-13 23:23:46 +0000
commit7bb2f97a90c73e709ac299947dae2cd7b4953af3 (patch)
treee4a5a4ae9d94b89c7ea37d3afda40fe164dcfc6c /llvm/lib
parent97e07bf211c33c2aafde1b09333e55f7630eb3a2 (diff)
downloadbcm5719-llvm-7bb2f97a90c73e709ac299947dae2cd7b4953af3.tar.gz
bcm5719-llvm-7bb2f97a90c73e709ac299947dae2cd7b4953af3.zip
Use the new MI bundling API in MachineInstrBundle itself.
The new API is higher level than just manipulating the bundle flags directly, and the setIsInsideBundle() function will disappear soon. llvm-svn: 170159
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineInstrBundle.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineInstrBundle.cpp b/llvm/lib/CodeGen/MachineInstrBundle.cpp
index dd46ecb17de..ffca550f8b6 100644
--- a/llvm/lib/CodeGen/MachineInstrBundle.cpp
+++ b/llvm/lib/CodeGen/MachineInstrBundle.cpp
@@ -47,8 +47,8 @@ bool UnpackMachineBundles::runOnMachineFunction(MachineFunction &MF) {
// Remove BUNDLE instruction and the InsideBundle flags from bundled
// instructions.
if (MI->isBundle()) {
- while (++MII != MIE && MII->isInsideBundle()) {
- MII->setIsInsideBundle(false);
+ while (++MII != MIE && MII->isBundledWithPred()) {
+ MII->unbundleFromPred();
for (unsigned i = 0, e = MII->getNumOperands(); i != e; ++i) {
MachineOperand &MO = MII->getOperand(i);
if (MO.isReg() && MO.isInternalRead())
@@ -101,13 +101,15 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB,
MachineBasicBlock::instr_iterator FirstMI,
MachineBasicBlock::instr_iterator LastMI) {
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();
- MachineInstrBuilder MIB = BuildMI(MBB, FirstMI, FirstMI->getDebugLoc(),
+ MachineInstrBuilder MIB = BuildMI(*MBB.getParent(), FirstMI->getDebugLoc(),
TII->get(TargetOpcode::BUNDLE));
+ Bundle.prepend(MIB);
SmallVector<unsigned, 32> LocalDefs;
SmallSet<unsigned, 32> LocalDefSet;
@@ -177,7 +179,6 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB,
}
}
- FirstMI->setIsInsideBundle();
Defs.clear();
}
OpenPOWER on IntegriCloud