summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-01-08 23:10:50 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-01-08 23:10:50 +0000
commit358de24dc121cd21911f3248b599178c86e9b467 (patch)
treefd538285703e4951a9ca065c65518e04e0185cf9 /include
parent7c8818630991855830c94c79e1035222f3749689 (diff)
downloadllvm-358de24dc121cd21911f3248b599178c86e9b467.tar.gz
llvm-358de24dc121cd21911f3248b599178c86e9b467.tar.bz2
llvm-358de24dc121cd21911f3248b599178c86e9b467.tar.xz
Use an IndexedMap for LiveOutRegInfo to hide its dependence on TargetRegisterInfo::FirstVirtualRegister.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123096 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/IndexedMap.h4
-rw-r--r--include/llvm/CodeGen/FunctionLoweringInfo.h7
2 files changed, 8 insertions, 3 deletions
diff --git a/include/llvm/ADT/IndexedMap.h b/include/llvm/ADT/IndexedMap.h
index 89f0dfa64e..78532bda39 100644
--- a/include/llvm/ADT/IndexedMap.h
+++ b/include/llvm/ADT/IndexedMap.h
@@ -65,6 +65,10 @@ namespace llvm {
storage_.resize(NewSize, nullVal_);
}
+ bool inBounds(IndexT n) const {
+ return toIndex_(n) < storage_.size();
+ }
+
typename StorageT::size_type size() const {
return storage_.size();
}
diff --git a/include/llvm/CodeGen/FunctionLoweringInfo.h b/include/llvm/CodeGen/FunctionLoweringInfo.h
index f17fe5a146..27631b7ea1 100644
--- a/include/llvm/CodeGen/FunctionLoweringInfo.h
+++ b/include/llvm/CodeGen/FunctionLoweringInfo.h
@@ -19,6 +19,7 @@
#include "llvm/Instructions.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/IndexedMap.h"
#include "llvm/ADT/SmallVector.h"
#ifndef NDEBUG
#include "llvm/ADT/SmallSet.h"
@@ -27,6 +28,7 @@
#include "llvm/CodeGen/ISDOpcodes.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/Support/CallSite.h"
+#include "llvm/Target/TargetRegisterInfo.h"
#include <vector>
namespace llvm {
@@ -104,9 +106,8 @@ public:
LiveOutInfo() : NumSignBits(0), KnownOne(1, 0), KnownZero(1, 0) {}
};
- /// LiveOutRegInfo - Information about live out vregs, indexed by their
- /// register number offset by 'FirstVirtualRegister'.
- std::vector<LiveOutInfo> LiveOutRegInfo;
+ /// 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.