aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT
diff options
context:
space:
mode:
authorJohn Mosby <ojomojo@gmail.com>2009-05-11 17:04:19 +0000
committerJohn Mosby <ojomojo@gmail.com>2009-05-11 17:04:19 +0000
commitb9cfbd94abb23ec8646b9b10aa4ac3d1cbf4461e (patch)
tree3ccfd69920af397b6587640a934c4292f135f59b /include/llvm/ADT
parent589b1efe1b83a43cf89a41841664ce0b4ae3e838 (diff)
downloadexternal_llvm-b9cfbd94abb23ec8646b9b10aa4ac3d1cbf4461e.zip
external_llvm-b9cfbd94abb23ec8646b9b10aa4ac3d1cbf4461e.tar.gz
external_llvm-b9cfbd94abb23ec8646b9b10aa4ac3d1cbf4461e.tar.bz2
Shrink wrapping in PEI:
- reduces _static_ callee saved register spills and restores similar to Chow's original algorithm. - iterative implementation with simple heuristic limits to mitigate compile time impact. - handles placing spills/restores for multi-entry, multi-exit regions in the Machine CFG without splitting edges. - passes test-suite in LLCBETA mode. Added contains() method to ADT/SparseBitVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT')
-rw-r--r--include/llvm/ADT/SparseBitVector.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/llvm/ADT/SparseBitVector.h b/include/llvm/ADT/SparseBitVector.h
index 70cb7f4..72627b1 100644
--- a/include/llvm/ADT/SparseBitVector.h
+++ b/include/llvm/ADT/SparseBitVector.h
@@ -641,8 +641,8 @@ public:
return changed;
}
- // Intersect our bitmap with the complement of the RHS and return true if ours
- // changed.
+ // Intersect our bitmap with the complement of the RHS and return true
+ // if ours changed.
bool intersectWithComplement(const SparseBitVector &RHS) {
bool changed = false;
ElementListIter Iter1 = Elements.begin();
@@ -685,8 +685,8 @@ public:
}
- // Three argument version of intersectWithComplement. Result of RHS1 & ~RHS2
- // is stored into this bitmap.
+ // Three argument version of intersectWithComplement.
+ // Result of RHS1 & ~RHS2 is stored into this bitmap.
void intersectWithComplement(const SparseBitVector<ElementSize> &RHS1,
const SparseBitVector<ElementSize> &RHS2)
{
@@ -775,6 +775,14 @@ public:
return false;
}
+ // Return true iff all bits set in this SparseBitVector are
+ // also set in RHS.
+ bool contains(const SparseBitVector<ElementSize> &RHS) const {
+ SparseBitVector<ElementSize> Result(*this);
+ Result &= RHS;
+ return (Result == RHS);
+ }
+
// Return the first set bit in the bitmap. Return -1 if no bits are set.
int find_first() const {
if (Elements.empty())
@@ -875,6 +883,8 @@ operator-(const SparseBitVector<ElementSize> &LHS,
}
+
+
// Dump a SparseBitVector to a stream
template <unsigned ElementSize>
void dump(const SparseBitVector<ElementSize> &LHS, llvm::OStream &out) {