aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RenderMachineFunction.h
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2010-07-20 07:41:44 +0000
committerLang Hames <lhames@gmail.com>2010-07-20 07:41:44 +0000
commitc4bcc778a8dcc385b129852c9aa1c712d042ad63 (patch)
tree087b246b968e89f6216c821b973e2fe0da37f5b9 /lib/CodeGen/RenderMachineFunction.h
parent735317c0e83bd52bd3ab3e6d574a0640f722af47 (diff)
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
Diffstat (limited to 'lib/CodeGen/RenderMachineFunction.h')
-rw-r--r--lib/CodeGen/RenderMachineFunction.h20
1 files changed, 14 insertions, 6 deletions
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 <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;
-
};
}