Another follow-up related to r240848: try a little harder to share slot
tracking calculations within a single `MachineInstr` dump. This is
unrelated to `MachineFunction::print()`, since that should be passing
through the function's `ModuleSlotTracker` by now, but could affect the
speed of dumping from a debugger if there is more than one IR-level
operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240852
91177308-0d34-0410-b5e6-
96231b3b80d8
}
void MachineInstr::print(raw_ostream &OS, bool SkipOpers) const {
- ModuleSlotTracker DummyMST(nullptr);
- print(OS, DummyMST, SkipOpers);
+ const Module *M = nullptr;
+ if (const MachineBasicBlock *MBB = getParent())
+ if (const MachineFunction *MF = MBB->getParent())
+ M = MF->getFunction()->getParent();
+
+ ModuleSlotTracker MST(M);
+ print(OS, MST, SkipOpers);
}
void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,