aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RenderMachineFunction.h
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2010-07-20 10:18:54 +0000
committerLang Hames <lhames@gmail.com>2010-07-20 10:18:54 +0000
commit8598a6ba4e6d974c7be1d0f993031b8713da6184 (patch)
tree79eb2d6a1b6172d58ceb55bb870c93e206593062 /lib/CodeGen/RenderMachineFunction.h
parent5ec4614a0b90235bbd7588602507dfae0bff53e0 (diff)
downloadexternal_llvm-8598a6ba4e6d974c7be1d0f993031b8713da6184.tar.gz
external_llvm-8598a6ba4e6d974c7be1d0f993031b8713da6184.tar.bz2
external_llvm-8598a6ba4e6d974c7be1d0f993031b8713da6184.zip
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RenderMachineFunction.h')
-rw-r--r--lib/CodeGen/RenderMachineFunction.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/CodeGen/RenderMachineFunction.h b/lib/CodeGen/RenderMachineFunction.h
index 1e604da138..090b03ecd6 100644
--- a/lib/CodeGen/RenderMachineFunction.h
+++ b/lib/CodeGen/RenderMachineFunction.h
@@ -223,6 +223,11 @@ namespace llvm {
const char *renderSuffix = 0);
private:
+ class Spacer;
+
+ template <typename OStream>
+ 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 <typename OStream, typename CellType>
+ void renderCellsWithRLE(
+ const Spacer &indent, OStream &os,
+ const std::pair<CellType, unsigned> &rleAccumulator,
+ const std::map<CellType, std::string> &cellTypeStrs) const;
+
/// \brief Render code listing, potentially with register pressure
/// and live intervals shown alongside.
template <typename OStream>