diff options
author | Chris Lattner <sabre@nondot.org> | 2006-08-24 23:22:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-08-24 23:22:59 +0000 |
commit | c82b3aab6502a9766ddf42b45faeca3d6fa0ad65 (patch) | |
tree | a19d301d2018377f605a904e82f7648bbcfb1eab /lib/CodeGen/LiveInterval.cpp | |
parent | bf16982e86d70ab1c09279d3032d76d9d57d6de5 (diff) |
When replacing value numbers, make sure to compactify the value # space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveInterval.cpp')
-rw-r--r-- | lib/CodeGen/LiveInterval.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index a8c01daf41..4752b6df51 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -470,6 +470,18 @@ void LiveInterval::MergeValueNumberInto(unsigned V1, unsigned V2) { } } } + + // Now that V1 is dead, remove it. If it is the largest value number, just + // nuke it (and any other deleted values neighboring it), otherwise mark it as + // ~1U so it can be nuked later. + if (V1 == NumValues-1) { + do { + InstDefiningValue.pop_back(); + --NumValues; + } while (InstDefiningValue.back() == ~1U); + } else { + InstDefiningValue[V1] = ~1U; + } } |