diff options
author | Andrew Trick <atrick@apple.com> | 2013-12-13 18:37:03 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2013-12-13 18:37:03 +0000 |
commit | 539e93120cdbb66f651fc55a810416f3175adc8f (patch) | |
tree | e845453b166d6f8b462ef306f7e9b0d7cede2bbf /include/llvm/CodeGen/StackMaps.h | |
parent | edf1070ca74f7d646bce2c66db9f443d09e7d1d3 (diff) | |
download | llvm-539e93120cdbb66f651fc55a810416f3175adc8f.tar.gz llvm-539e93120cdbb66f651fc55a810416f3175adc8f.tar.bz2 llvm-539e93120cdbb66f651fc55a810416f3175adc8f.tar.xz |
Liveness Analysis Pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/StackMaps.h')
-rw-r--r-- | include/llvm/CodeGen/StackMaps.h | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/StackMaps.h b/include/llvm/CodeGen/StackMaps.h index ef4657b139..19bc36e4dc 100644 --- a/include/llvm/CodeGen/StackMaps.h +++ b/include/llvm/CodeGen/StackMaps.h @@ -92,6 +92,20 @@ public: : LocType(LocType), Size(Size), Reg(Reg), Offset(Offset) {} }; + struct LiveOutReg { + unsigned short Reg; + unsigned short RegNo; + unsigned short Size; + + LiveOutReg() : Reg(0), RegNo(0), Size(0) {} + LiveOutReg(unsigned short Reg, unsigned short RegNo, unsigned short Size) + : Reg(Reg), RegNo(RegNo), Size(Size) {} + + // Only sort by the dwarf register number. + bool operator< (const LiveOutReg &LO) const { return RegNo < LO.RegNo; } + static bool isInvalid(const LiveOutReg &LO) { return LO.Reg == 0; } + }; + // OpTypes are used to encode information about the following logical // operand (which may consist of several MachineOperands) for the // OpParser. @@ -114,15 +128,18 @@ public: private: typedef SmallVector<Location, 8> LocationVec; + typedef SmallVector<LiveOutReg, 8> LiveOutVec; struct CallsiteInfo { const MCExpr *CSOffsetExpr; unsigned ID; LocationVec Locations; + LiveOutVec LiveOuts; CallsiteInfo() : CSOffsetExpr(0), ID(0) {} CallsiteInfo(const MCExpr *CSOffsetExpr, unsigned ID, - LocationVec Locations) - : CSOffsetExpr(CSOffsetExpr), ID(ID), Locations(Locations) {} + LocationVec &Locations, LiveOutVec &LiveOuts) + : CSOffsetExpr(CSOffsetExpr), ID(ID), Locations(Locations), + LiveOuts(LiveOuts) {} }; typedef std::vector<CallsiteInfo> CallsiteInfoList; @@ -154,8 +171,15 @@ private: /// Parse std::pair<Location, MachineInstr::const_mop_iterator> parseOperand(MachineInstr::const_mop_iterator MOI, - MachineInstr::const_mop_iterator MOE); - + MachineInstr::const_mop_iterator MOE) const; + + /// \brief Create a live-out register record for the given register @p Reg. + LiveOutReg createLiveOutReg(unsigned Reg, const MCRegisterInfo &MCRI, + const TargetRegisterInfo *TRI) const; + + /// \brief Parse the register live-out mask and return a vector of live-out + /// registers that need to be recorded in the stackmap. + LiveOutVec parseRegisterLiveOutMask(const uint32_t *Mask) const; /// This should be called by the MC lowering code _immediately_ before /// lowering the MI to an MCInst. It records where the operands for the |