[llvm] 8ec9840 - [CodeGen] Add dump() to MachineTraceMetrics.h

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 5 03:19:30 PDT 2024


Author: Pengcheng Wang
Date: 2024-07-05T18:19:27+08:00
New Revision: 8ec9840610262b62a7dbb7dcf7056f4b97fd5ca9

URL: https://github.com/llvm/llvm-project/commit/8ec9840610262b62a7dbb7dcf7056f4b97fd5ca9
DIFF: https://github.com/llvm/llvm-project/commit/8ec9840610262b62a7dbb7dcf7056f4b97fd5ca9.diff

LOG: [CodeGen] Add dump() to MachineTraceMetrics.h

To enhance debugging.

Reviewers: arsenm, goldsteinn, RKSimon, dtcxzyw, asi-sc

Reviewed By: dtcxzyw, RKSimon

Pull Request: https://github.com/llvm/llvm-project/pull/97799

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/MachineTraceMetrics.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/MachineTraceMetrics.h b/llvm/include/llvm/CodeGen/MachineTraceMetrics.h
index fce78581a48c4..a5e78d47724d8 100644
--- a/llvm/include/llvm/CodeGen/MachineTraceMetrics.h
+++ b/llvm/include/llvm/CodeGen/MachineTraceMetrics.h
@@ -243,6 +243,7 @@ class MachineTraceMetrics : public MachineFunctionPass {
     SmallVector<LiveInReg, 4> LiveIns;
 
     void print(raw_ostream&) const;
+    void dump() const { print(dbgs()); }
   };
 
   /// InstrCycles represents the cycle height and depth of an instruction in a
@@ -271,6 +272,7 @@ class MachineTraceMetrics : public MachineFunctionPass {
     explicit Trace(Ensemble &te, TraceBlockInfo &tbi) : TE(te), TBI(tbi) {}
 
     void print(raw_ostream&) const;
+    void dump() const { print(dbgs()); }
 
     /// Compute the total number of instructions in the trace.
     unsigned getInstrCount() const {
@@ -361,7 +363,8 @@ class MachineTraceMetrics : public MachineFunctionPass {
     virtual ~Ensemble();
 
     virtual const char *getName() const = 0;
-    void print(raw_ostream&) const;
+    void print(raw_ostream &) const;
+    void dump() const { print(dbgs()); }
     void invalidate(const MachineBasicBlock *MBB);
     void verify() const;
 


        


More information about the llvm-commits mailing list