From 69b8873a33af59f7ded4f5e1924bfe3f4cdd48e5 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sun, 8 Feb 2009 07:48:37 +0000 Subject: git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64073 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/LiveInterval.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/llvm/CodeGen') diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index fb74486..f06ca43 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 &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 -- cgit v1.1