diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-04-11 17:53:36 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-04-11 17:53:36 +0000 |
commit | 4cce6b4c7882ef0cc993d931b90bf33985c96110 (patch) | |
tree | ae568a7364fb4567178847ebd911b4c94ae62a42 /lib/CodeGen/VirtRegMap.h | |
parent | 6b893fced8ce8ac711d4fd6718f56c921ad8a6e3 (diff) | |
download | llvm-4cce6b4c7882ef0cc993d931b90bf33985c96110.tar.gz llvm-4cce6b4c7882ef0cc993d931b90bf33985c96110.tar.bz2 llvm-4cce6b4c7882ef0cc993d931b90bf33985c96110.tar.xz |
Use of implicit_def is not part of live interval. Create empty intervals for the uses when the live interval is being spilled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.h')
-rw-r--r-- | lib/CodeGen/VirtRegMap.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/CodeGen/VirtRegMap.h b/lib/CodeGen/VirtRegMap.h index 6f82cfb62c..46f177d4f5 100644 --- a/lib/CodeGen/VirtRegMap.h +++ b/lib/CodeGen/VirtRegMap.h @@ -18,6 +18,7 @@ #define LLVM_CODEGEN_VIRTREGMAP_H #include "llvm/Target/TargetRegisterInfo.h" +#include "llvm/ADT/BitVector.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/IndexedMap.h" #include "llvm/ADT/SmallPtrSet.h" @@ -116,6 +117,10 @@ namespace llvm { /// SpillSlotToUsesMap - Records uses for each register spill slot. SmallVector<SmallPtrSet<MachineInstr*, 4>, 8> SpillSlotToUsesMap; + /// ImplicitDefed - One bit for each virtual register. If set it indicates + /// the register is implicitly defined. + BitVector ImplicitDefed; + VirtRegMap(const VirtRegMap&); // DO NOT IMPLEMENT void operator=(const VirtRegMap&); // DO NOT IMPLEMENT @@ -382,6 +387,16 @@ namespace llvm { return !SpillSlotToUsesMap[FrameIndex-LowSpillSlot].empty(); } + /// @brief Mark the specified register as being implicitly defined. + void setIsImplicitlyDefined(unsigned VirtReg) { + ImplicitDefed.set(VirtReg-TargetRegisterInfo::FirstVirtualRegister); + } + + /// @brief Returns true if the virtual register is implicitly defined. + bool isImplicitlyDefined(unsigned VirtReg) const { + return ImplicitDefed[VirtReg-TargetRegisterInfo::FirstVirtualRegister]; + } + /// @brief Updates information about the specified virtual register's value /// folded into newMI machine instruction. void virtFolded(unsigned VirtReg, MachineInstr *OldMI, MachineInstr *NewMI, |