diff options
author | Lang Hames <lhames@gmail.com> | 2010-07-20 07:41:44 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2010-07-20 07:41:44 +0000 |
commit | a93fe2de3c6ae2297354f4ff1c15fd4159199f01 (patch) | |
tree | dd8ea038a2f17f866ec89c1354842a8063399691 /llvm/lib/CodeGen/RenderMachineFunction.h | |
parent | 865f0473d09394d559c9d19fe245fbe5152987b8 (diff) | |
download | bcm5719-llvm-a93fe2de3c6ae2297354f4ff1c15fd4159199f01.tar.gz bcm5719-llvm-a93fe2de3c6ae2297354f4ff1c15fd4159199f01.zip |
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.
llvm-svn: 108815
Diffstat (limited to 'llvm/lib/CodeGen/RenderMachineFunction.h')
-rw-r--r-- | llvm/lib/CodeGen/RenderMachineFunction.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/RenderMachineFunction.h b/llvm/lib/CodeGen/RenderMachineFunction.h index b2ccc3e1fa4..743938d9edb 100644 --- a/llvm/lib/CodeGen/RenderMachineFunction.h +++ b/llvm/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 <typename Iterator> std::string escapeChars(Iterator sBegin, Iterator sEnd) const; + /// \brief Render a machine instruction. + template <typename OStream> + void renderMachineInstr(OStream &os, + const MachineInstr *mi) const; + /// \brief Render vertical text. template <typename OStream, typename T> 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; - }; } |