aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/LiveInterval.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h
index 71daf61..e8378f2 100644
--- a/include/llvm/CodeGen/LiveInterval.h
+++ b/include/llvm/CodeGen/LiveInterval.h
@@ -166,8 +166,23 @@ namespace llvm {
/// addKillForValNum - Add a kill instruction index to the specified value
/// number.
void addKillForValNum(unsigned ValNo, unsigned KillIdx) {
+ assert(ValNo < ValueNumberInfo.size());
ValueNumberInfo[ValNo].kills.push_back(KillIdx);
}
+
+ /// replaceKillForValNum - Replace a kill index of the specified value with
+ /// a new kill index.
+ bool replaceKillForValNum(unsigned ValNo, unsigned OldKill,
+ unsigned NewKill) {
+ SmallVector<unsigned, 4> kills = ValueNumberInfo[ValNo].kills;
+ SmallVector<unsigned, 4>::iterator I =
+ std::find(kills.begin(), kills.end(), OldKill);
+ if (I == kills.end())
+ return false;
+ kills.erase(I);
+ kills.push_back(NewKill);
+ return true;
+ }
VNInfo getValNumInfo(unsigned ValNo) const {
assert(ValNo < ValueNumberInfo.size());