From c7f1eac51436d5feda7a831e44d0ddb86678462e Mon Sep 17 00:00:00 2001 From: Kyle Butt Date: Thu, 25 Aug 2016 01:37:07 +0000 Subject: [PATCH] TailDuplication: Don't pass MMI separately from MF. NFC 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 | 2 +- llvm/lib/CodeGen/TailDuplication.cpp | 2 +- llvm/lib/CodeGen/TailDuplicator.cpp | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/CodeGen/TailDuplicator.h b/llvm/include/llvm/CodeGen/TailDuplicator.h index e70029e..03fd499 100644 --- a/llvm/include/llvm/CodeGen/TailDuplicator.h +++ b/llvm/include/llvm/CodeGen/TailDuplicator.h @@ -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(); diff --git a/llvm/lib/CodeGen/TailDuplication.cpp b/llvm/lib/CodeGen/TailDuplication.cpp index d603400..6e8ee9e 100644 --- a/llvm/lib/CodeGen/TailDuplication.cpp +++ b/llvm/lib/CodeGen/TailDuplication.cpp @@ -49,7 +49,7 @@ bool TailDuplicatePass::runOnMachineFunction(MachineFunction &MF) { auto MBPI = &getAnalysis(); - Duplicator.initMF(MF, MMI, MBPI); + Duplicator.initMF(MF, MBPI); bool MadeChange = false; while (Duplicator.tailDuplicateBlocks()) diff --git a/llvm/lib/CodeGen/TailDuplicator.cpp b/llvm/lib/CodeGen/TailDuplicator.cpp index 2a25b3d..bf3379eb 100644 --- a/llvm/lib/CodeGen/TailDuplicator.cpp +++ b/llvm/lib/CodeGen/TailDuplicator.cpp @@ -57,14 +57,13 @@ static cl::opt 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; -- 2.7.4