TailDuplication: Don't pass MMI separately from MF. NFC
authorKyle Butt <kyle+llvm@iteratee.net>
Thu, 25 Aug 2016 01:37:07 +0000 (01:37 +0000)
committerKyle Butt <kyle+llvm@iteratee.net>
Thu, 25 Aug 2016 01:37:07 +0000 (01:37 +0000)
MMI must match the function passed, and MF has a handle on MMI. Use that instead
of accepting it as separate argument. No Functional Change.

llvm-svn: 279701

llvm/include/llvm/CodeGen/TailDuplicator.h
llvm/lib/CodeGen/TailDuplication.cpp
llvm/lib/CodeGen/TailDuplicator.cpp

index e70029e..03fd499 100644 (file)
@@ -49,7 +49,7 @@ class TailDuplicator {
 public:
   /// Prepare to run on a specific machine function.
   /// @param TailDupSize - Maxmimum size of blocks to tail-duplicate.
-  void initMF(MachineFunction &MF, const MachineModuleInfo *MMI,
+  void initMF(MachineFunction &MF,
               const MachineBranchProbabilityInfo *MBPI,
               unsigned TailDupSize = 0);
   bool tailDuplicateBlocks();
index d603400..6e8ee9e 100644 (file)
@@ -49,7 +49,7 @@ bool TailDuplicatePass::runOnMachineFunction(MachineFunction &MF) {
 
   auto MBPI = &getAnalysis<MachineBranchProbabilityInfo>();
 
-  Duplicator.initMF(MF, MMI, MBPI);
+  Duplicator.initMF(MF, MBPI);
 
   bool MadeChange = false;
   while (Duplicator.tailDuplicateBlocks())
index 2a25b3d..bf3379e 100644 (file)
@@ -57,14 +57,13 @@ static cl::opt<unsigned> TailDupLimit("tail-dup-limit", cl::init(~0U),
 namespace llvm {
 
 void TailDuplicator::initMF(MachineFunction &MFin,
-                            const MachineModuleInfo *MMIin,
                             const MachineBranchProbabilityInfo *MBPIin,
                             unsigned TailDupSizeIn) {
   MF = &MFin;
   TII = MF->getSubtarget().getInstrInfo();
   TRI = MF->getSubtarget().getRegisterInfo();
   MRI = &MF->getRegInfo();
-  MMI = MMIin;
+  MMI = &MF->getMMI();
   MBPI = MBPIin;
   TailDupSize = TailDupSizeIn;