aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/LiveInterval.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-02-08 07:48:37 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-02-08 07:48:37 +0000
commit77fde2cbb1fbf9daf5235fa734c6c09b2d530617 (patch)
tree8270f14559be966445f51c716ca4895764843a78 /include/llvm/CodeGen/LiveInterval.h
parentda01af76670f4e7296923bcf9382465875ef9b0a (diff)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/LiveInterval.h')
-rw-r--r--include/llvm/CodeGen/LiveInterval.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h
index fb74486357..f06ca43f2b 100644
--- a/include/llvm/CodeGen/LiveInterval.h
+++ b/include/llvm/CodeGen/LiveInterval.h
@@ -271,6 +271,19 @@ namespace llvm {
I = std::lower_bound(kills.begin(), kills.end(), KillIdx);
return I != kills.end() && *I == KillIdx;
}
+
+ /// isOnlyKill - Return true if the specified index is the only kill of the
+ /// specified val#.
+ static bool isOnlyKill(const VNInfo *VNI, unsigned KillIdx) {
+ bool Found = false;
+ const SmallVector<unsigned, 4> &kills = VNI->kills;
+ for (unsigned i = 0, e = kills.size(); i != e; ++i) {
+ if (KillIdx != kills[i])
+ return false;
+ Found = true;
+ }
+ return Found;
+ }
/// MergeValueNumberInto - This method is called when two value nubmers
/// are found to be equivalent. This eliminates V1, replacing all