]> granicus.if.org Git - llvm/commitdiff
include function name in dot filename
authorXinliang David Li <davidxl@google.com>
Wed, 15 Feb 2017 19:21:04 +0000 (19:21 +0000)
committerXinliang David Li <davidxl@google.com>
Wed, 15 Feb 2017 19:21:04 +0000 (19:21 +0000)
Differential Revision: http://reviews.llvm.org/D29975

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295220 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineBlockFrequencyInfo.h
lib/CodeGen/BranchFolding.cpp
lib/CodeGen/BranchFolding.h
lib/CodeGen/MachineBlockFrequencyInfo.cpp
lib/CodeGen/MachineBlockPlacement.cpp

index ead0012e700fcc76736d856c341ca39f6fd4e1c4..cd1c204981ed86760ad2d377dfb83dc7c5e086b5 100644 (file)
@@ -62,7 +62,7 @@ public:
 
   const MachineFunction *getFunction() const;
   const MachineBranchProbabilityInfo *getMBPI() const;
-  void view(bool isSimple = true) const;
+  void view(const Twine &Name, bool isSimple = true) const;
 
   // Print the block frequency Freq to OS using the current functions entry
   // frequency to convert freq into a relative decimal form.
index d148a9dbac549da793bb60d47b962402d42fafbb..4a9e15ebd766226da62a291602d7367ccf7d2ede 100644 (file)
@@ -497,7 +497,9 @@ BranchFolder::MBFIWrapper::printBlockFreq(raw_ostream &OS,
   return MBFI.printBlockFreq(OS, Freq);
 }
 
-void BranchFolder::MBFIWrapper::view(bool isSimple) { MBFI.view(isSimple); }
+void BranchFolder::MBFIWrapper::view(const Twine &Name, bool isSimple) {
+  MBFI.view(Name, isSimple);
+}
 
 uint64_t
 BranchFolder::MBFIWrapper::getEntryFreq() const {
index c547e3a8ebd61e323d2d2f17546b3b66dd0e8623..0773a2c86dedb359ec8ef3a2685a09972f9dba02 100644 (file)
@@ -122,7 +122,7 @@ namespace llvm {
                                   const MachineBasicBlock *MBB) const;
       raw_ostream &printBlockFreq(raw_ostream &OS,
                                   const BlockFrequency Freq) const;
-      void view(bool isSimple = true);
+      void view(const Twine &Name, bool isSimple = true);
       uint64_t getEntryFreq() const;
 
     private:
index 557b5f8824d5a008c1a60c63637064bc540d324e..9c7367b4c78020ecb2b6260658c8a67f46d00750 100644 (file)
@@ -181,7 +181,7 @@ void MachineBlockFrequencyInfo::calculate(
   if (ViewMachineBlockFreqPropagationDAG != GVDT_None &&
       (ViewBlockFreqFuncName.empty() ||
        F.getName().equals(ViewBlockFreqFuncName))) {
-    view();
+    view("MachineBlockFrequencyDAGS." + F.getName());
   }
 }
 
@@ -197,10 +197,9 @@ void MachineBlockFrequencyInfo::releaseMemory() { MBFI.reset(); }
 
 /// Pop up a ghostview window with the current block frequency propagation
 /// rendered using dot.
-void MachineBlockFrequencyInfo::view(bool isSimple) const {
-// This code is only for debugging.
-  ViewGraph(const_cast<MachineBlockFrequencyInfo *>(this),
-            "MachineBlockFrequencyDAGs", isSimple);
+void MachineBlockFrequencyInfo::view(const Twine &Name, bool isSimple) const {
+  // This code is only for debugging.
+  ViewGraph(const_cast<MachineBlockFrequencyInfo *>(this), Name, isSimple);
 }
 
 BlockFrequency
index 8a57f0099751045a7296c24362a34ef4a4b0c052..bfc90e0d8cdc792da6300b7dfce43ad5caf8b7f4 100644 (file)
@@ -2381,7 +2381,7 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &MF) {
   if (ViewBlockLayoutWithBFI != GVDT_None &&
       (ViewBlockFreqFuncName.empty() ||
        F->getFunction()->getName().equals(ViewBlockFreqFuncName))) {
-    MBFI->view(false);
+    MBFI->view("MBP." + MF.getName(), false);
   }