summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit3c86b78ae4d03a31ae4f38dc70659c408d324880 (patch)
treeaf1f96e7d6e11c9e3a4f4cfe049557c8d42e293c /llvm/lib/CodeGen/StackColoring.cpp
parentfc57cdf5b87c473501c8af9421c93714bf05c349 (diff)
downloadbcm5719-llvm-3c86b78ae4d03a31ae4f38dc70659c408d324880.tar.gz
bcm5719-llvm-3c86b78ae4d03a31ae4f38dc70659c408d324880.zip
Stack Coloring: Handle the case where END markers come before BEGIN markers properly.
llvm-svn: 163530
Diffstat (limited to 'llvm/lib/CodeGen/StackColoring.cpp')
-rw-r--r--llvm/lib/CodeGen/StackColoring.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/StackColoring.cpp b/llvm/lib/CodeGen/StackColoring.cpp
index 462a134ace3..927ecef1716 100644
--- a/llvm/lib/CodeGen/StackColoring.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud