diff options
author | Cameron Zwarich <zwarich@apple.com> | 2011-02-24 10:00:08 +0000 |
---|---|---|
committer | Cameron Zwarich <zwarich@apple.com> | 2011-02-24 10:00:08 +0000 |
commit | e1497b979166765d97c91813a8e830a1ab8fbe12 (patch) | |
tree | 58c541e4d179daabab14b84c728075ffc8379fb7 /include/llvm/CodeGen/FunctionLoweringInfo.h | |
parent | 2dbe2850d019d3d25ec760f34de70ef6c9ac5747 (diff) |
Refactor the LiveOutInfo interface into a few methods on FunctionLoweringInfo
and make the actual map private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126376 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/FunctionLoweringInfo.h')
-rw-r--r-- | include/llvm/CodeGen/FunctionLoweringInfo.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/FunctionLoweringInfo.h b/include/llvm/CodeGen/FunctionLoweringInfo.h index 27631b7ea1..7f03a7a0f7 100644 --- a/include/llvm/CodeGen/FunctionLoweringInfo.h +++ b/include/llvm/CodeGen/FunctionLoweringInfo.h @@ -105,9 +105,6 @@ public: APInt KnownOne, KnownZero; LiveOutInfo() : NumSignBits(0), KnownOne(1, 0), KnownZero(1, 0) {} }; - - /// LiveOutRegInfo - Information about live out vregs. - IndexedMap<LiveOutInfo, VirtReg2IndexFunctor> LiveOutRegInfo; /// PHINodesToUpdate - A list of phi instructions whose operand list will /// be updated after processing the current basic block. @@ -143,12 +140,38 @@ public: return R = CreateRegs(V->getType()); } + /// GetLiveOutRegInfo - Gets LiveOutInfo for a register, returning NULL if the + /// register is a PHI destination and the PHI's LiveOutInfo is not valid. + const LiveOutInfo *GetLiveOutRegInfo(unsigned Reg) { + if (!LiveOutRegInfo.inBounds(Reg)) + return NULL; + return &LiveOutRegInfo[Reg]; + } + + /// AddLiveOutRegInfo - Adds LiveOutInfo for a register. + void AddLiveOutRegInfo(unsigned Reg, unsigned NumSignBits, + const APInt &KnownZero, const APInt &KnownOne) { + // Only install this information if it tells us something. + if (NumSignBits == 1 && KnownZero == 0 && KnownOne == 0) + return; + + LiveOutRegInfo.grow(Reg); + LiveOutInfo &LOI = LiveOutRegInfo[Reg]; + LOI.NumSignBits = NumSignBits; + LOI.KnownOne = KnownOne; + LOI.KnownZero = KnownZero; + } + /// setByValArgumentFrameIndex - Record frame index for the byval /// argument. void setByValArgumentFrameIndex(const Argument *A, int FI); /// getByValArgumentFrameIndex - Get frame index for the byval argument. int getByValArgumentFrameIndex(const Argument *A); + +private: + /// LiveOutRegInfo - Information about live out vregs. + IndexedMap<LiveOutInfo, VirtReg2IndexFunctor> LiveOutRegInfo; }; /// AddCatchInfo - Extract the personality and type infos from an eh.selector |