From a475ab7f02bbb859d49e4b0d18c07659b6fd4e48 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 20 Jul 2010 10:18:54 +0000 Subject: Use run-length encoding to represent identical adjacent cells in the pressure and interval table. Reduces output HTML file sizes by ~80% in my test cases. Also fix access of private member type by << operator. llvm-svn: 108823 --- llvm/lib/CodeGen/RenderMachineFunction.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/RenderMachineFunction.h') diff --git a/llvm/lib/CodeGen/RenderMachineFunction.h b/llvm/lib/CodeGen/RenderMachineFunction.h index 1e604da1381..090b03ecd65 100644 --- a/llvm/lib/CodeGen/RenderMachineFunction.h +++ b/llvm/lib/CodeGen/RenderMachineFunction.h @@ -223,6 +223,11 @@ namespace llvm { const char *renderSuffix = 0); private: + class Spacer; + + template + friend OStream& operator<<(OStream &os, const Spacer &s); + std::string fqn; @@ -238,9 +243,12 @@ namespace llvm { // Utilities. typedef enum { Dead, Defined, Used, AliveReg, AliveStack } LiveState; - LiveState getLiveStateAt(const LiveInterval *li, SlotIndex i) const; + typedef enum { Zero, Low, High } PressureState; + PressureState getPressureStateAt(const TargetRegisterClass *trc, + SlotIndex i) const; + // ---------- Rendering methods ---------- /// For inserting spaces when pretty printing. @@ -286,6 +294,14 @@ namespace llvm { void renderPressureTableLegend(const Spacer &indent, OStream &os) const; + /// \brief Render a consecutive set of HTML cells of the same class using + /// the colspan attribute for run-length encoding. + template + void renderCellsWithRLE( + const Spacer &indent, OStream &os, + const std::pair &rleAccumulator, + const std::map &cellTypeStrs) const; + /// \brief Render code listing, potentially with register pressure /// and live intervals shown alongside. template -- cgit v1.2.3