From c4bcc778a8dcc385b129852c9aa1c712d042ad63 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 20 Jul 2010 07:41:44 +0000 Subject: Switched to rendering after allocation (but before rewriting) in PBQP. Updated renderer to use allocation information from VirtRegMap (if available) to render spilled intervals differently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108815 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/RenderMachineFunction.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'lib/CodeGen/RenderMachineFunction.h') diff --git a/lib/CodeGen/RenderMachineFunction.h b/lib/CodeGen/RenderMachineFunction.h index b2ccc3e1fa..743938d9ed 100644 --- a/lib/CodeGen/RenderMachineFunction.h +++ b/lib/CodeGen/RenderMachineFunction.h @@ -30,7 +30,7 @@ namespace llvm { class MachineRegisterInfo; class TargetRegisterClass; class TargetRegisterInfo; - + class VirtRegMap; /// \brief Provide extra information about the physical and virtual registers /// in the function being compiled. @@ -212,10 +212,14 @@ namespace llvm { /// codegen pipeline) this function was rendered /// from. Set it to something like /// "Pre-register-allocation". + /// @param vrm If non-null the VRM will be queried to determine + /// whether a virtual register was allocated to a + /// physical register or spilled. /// @param renderFilePrefix This string will be appended to the function /// name (before the output file suffix) to enable /// multiple renderings from the same function. void renderMachineFunction(const char *renderContextStr, + const VirtRegMap *vrm = 0, const char *renderSuffix = 0); private: @@ -227,19 +231,26 @@ namespace llvm { const TargetRegisterInfo *tri; LiveIntervals *lis; SlotIndexes *sis; + const VirtRegMap *vrm; TargetRegisterExtraInfo trei; MFRenderingOptions ro; - // ---------- Utility functions ---------- + // Utilities. + typedef enum { Dead, Defined, Used, AliveReg, AliveStack } LiveState; - void setupRenderingOptions(); + LiveState getLiveStateAt(const LiveInterval *li, SlotIndex i) const; // ---------- Rendering methods ---------- template std::string escapeChars(Iterator sBegin, Iterator sEnd) const; + /// \brief Render a machine instruction. + template + void renderMachineInstr(OStream &os, + const MachineInstr *mi) const; + /// \brief Render vertical text. template void renderVertical(const std::string &indent, @@ -282,9 +293,6 @@ namespace llvm { const char * const renderContextStr) const; std::string escapeChars(const std::string &s) const; - - std::string escapeChars(const MachineInstr *mi) const; - }; } -- cgit v1.2.3-18-g5258