summaryrefslogtreecommitdiff
path: root/lib/CodeGen/StackColoring.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-09-10 18:51:09 +0000
committerNadav Rotem <nrotem@apple.com>2012-09-10 18:51:09 +0000
commit6165dba25f3374ce340b420ab9a360623c26fdc3 (patch)
tree49105ce9c5509b865b1fbe203fbc8d817f753457 /lib/CodeGen/StackColoring.cpp
parentb8150d852399f61f3fe7f6fd66edb99173de884c (diff)
downloadllvm-6165dba25f3374ce340b420ab9a360623c26fdc3.tar.gz
llvm-6165dba25f3374ce340b420ab9a360623c26fdc3.tar.bz2
llvm-6165dba25f3374ce340b420ab9a360623c26fdc3.tar.xz
Stack Coloring: Handle the case where END markers come before BEGIN markers properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/StackColoring.cpp')
-rw-r--r--lib/CodeGen/StackColoring.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/CodeGen/StackColoring.cpp b/lib/CodeGen/StackColoring.cpp
index 462a134ace..927ecef171 100644
--- a/lib/CodeGen/StackColoring.cpp
+++ b/lib/CodeGen/StackColoring.cpp
@@ -315,6 +315,18 @@ void StackColoring::calculateLocalLiveness() {
LocalLiveOut.reset(BlockLiveness[BB].End);
LocalLiveIn.reset(BlockLiveness[BB].Begin);
+ // If we have both BEGIN and END markers in the same basic block then
+ // we know that the BEGIN marker comes after the END, because we already
+ // handle the case where the BEGIN comes before the END when collecting
+ // the markers (and building the BEGIN/END vectore).
+ // Want to enable the LIVE_IN and LIVE_OUT of slots that have both
+ // BEGIN and END because it means that the value lives before and after
+ // this basic block.
+ BitVector LocalEndBegin = BlockLiveness[BB].End;
+ LocalEndBegin &= BlockLiveness[BB].Begin;
+ LocalLiveIn |= LocalEndBegin;
+ LocalLiveOut |= LocalEndBegin;
+
if (LocalLiveIn.test(BlockLiveness[BB].LiveIn)) {
changed = true;
BlockLiveness[BB].LiveIn |= LocalLiveIn;