diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-02-27 03:04:06 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-02-27 03:04:06 +0000 |
commit | d36531249a9a9500e516148e7e72d4c0a7a4d0ee (patch) | |
tree | 6989d7bcac7fd80359addc3fa13e899ff8961cfc /include/llvm/CodeGen | |
parent | 1953ecb0a6fc8520b34b52fd04f7476a7eb4613f (diff) | |
download | external_llvm-d36531249a9a9500e516148e7e72d4c0a7a4d0ee.zip external_llvm-d36531249a9a9500e516148e7e72d4c0a7a4d0ee.tar.gz external_llvm-d36531249a9a9500e516148e7e72d4c0a7a4d0ee.tar.bz2 |
Spiller now remove unused spill slots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47657 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/MachineFrameInfo.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineFrameInfo.h b/include/llvm/CodeGen/MachineFrameInfo.h index 9934bf6..856fb34 100644 --- a/include/llvm/CodeGen/MachineFrameInfo.h +++ b/include/llvm/CodeGen/MachineFrameInfo.h @@ -80,7 +80,8 @@ class MachineFrameInfo { // StackObject - Represent a single object allocated on the stack. struct StackObject { - // The size of this object on the stack. 0 means a variable sized object + // The size of this object on the stack. 0 means a variable sized object, + // ~0ULL means a dead object. uint64_t Size; // Alignment - The required alignment of this stack slot. @@ -292,6 +293,14 @@ public: return Objects[ObjectIdx+NumFixedObjects].isImmutable; } + /// isDeadObjectIndex - Returns true if the specified index corresponds to + /// a dead object. + bool isDeadObjectIndex(int ObjectIdx) const { + assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() && + "Invalid Object Idx!"); + return Objects[ObjectIdx+NumFixedObjects].Size == ~0ULL; + } + /// CreateStackObject - Create a new statically sized stack object, returning /// a postive identifier to represent it. /// @@ -304,6 +313,17 @@ public: return Objects.size()-NumFixedObjects-1; } + /// RemoveStackObject - Remove or mark dead a statically sized stack object. + /// + void RemoveStackObject(int ObjectIdx) { + if (ObjectIdx == (int)(Objects.size()-NumFixedObjects-1)) + // Last object, simply pop it off the list. + Objects.pop_back(); + else + // Mark it dead. + Objects[ObjectIdx+NumFixedObjects].Size = ~0ULL; + } + /// CreateVariableSizedObject - Notify the MachineFrameInfo object that a /// variable sized object has been created. This must be created whenever a /// variable sized object is created, whether or not the index returned is |