Added MachineInstr::isBundled() to check if an instruction is part of a bundle.
authorAndrew Trick <atrick@apple.com>
Wed, 8 Feb 2012 02:17:25 +0000 (02:17 +0000)
committerAndrew Trick <atrick@apple.com>
Wed, 8 Feb 2012 02:17:25 +0000 (02:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150044 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h
lib/CodeGen/LiveIntervalAnalysis.cpp
lib/CodeGen/MachineInstr.cpp

index f1c1cd129f81bdc6b0ab2c9fa9a5f7ee7963e40c..9a8ac7c029eb965ba03f01113a7418ca0269188e 100644 (file)
@@ -230,6 +230,10 @@ public:
       clearFlag(InsideBundle);
   }
 
+  /// isBundled - Return true if this instruction part of a bundle. This is true
+  /// if either itself or its following instruction is marked "InsideBundle".
+  bool isBundled() const;
+
   /// getDebugLoc - Returns the debug location id of this MachineInstr.
   ///
   DebugLoc getDebugLoc() const { return debugLoc; }
index cea75ef4b4d5d091d56c0fe8608473eee7d55496..4da4997ab676b87dd7ba4eda6969b5cd1c2f5aac 100644 (file)
@@ -904,7 +904,7 @@ void LiveIntervals::moveInstr(MachineBasicBlock::iterator insertPt,
   assert((insertPt == mbb->end() || insertPt->getParent() == mbb) &&
          "Cannot handle moves across basic block boundaries.");
   assert(&*insertPt != mi && "No-op move requested?");
-  assert(!mi->isInsideBundle() && "Can't handle bundled instructions yet.");
+  assert(!mi->isBundled() && "Can't handle bundled instructions yet.");
 
   // Grab the original instruction index.
   SlotIndex origIdx = indexes_->getInstructionIndex(mi);
index de2082a779b4df13e8c87bfa0eefa7325766ab18..fc5822da077aea5d36ca14b56427fe92ca747462 100644 (file)
@@ -890,6 +890,16 @@ unsigned MachineInstr::getNumExplicitOperands() const {
   return NumOperands;
 }
 
+/// isBundled - Return true if this instruction part of a bundle. This is true
+/// if either itself or its following instruction is marked "InsideBundle".
+bool MachineInstr::isBundled() const {
+  if (isInsideBundle())
+    return true;
+  MachineBasicBlock::const_instr_iterator nextMI = this;
+  ++nextMI;
+  return nextMI != Parent->instr_end() && nextMI->isInsideBundle();
+}
+
 bool MachineInstr::isStackAligningInlineAsm() const {
   if (isInlineAsm()) {
     unsigned ExtraInfo = getOperand(InlineAsm::MIOp_ExtraInfo).getImm();