summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/StackColoring.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-03-03 00:01:25 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-03-03 00:01:25 +0000
commit1ef654024f490b403494265c968570ca6bd800f3 (patch)
tree8915b153475cd3e51343662f1764be4d0b78a497 /llvm/lib/CodeGen/StackColoring.cpp
parentfe5a7109c5f800310dc7b0bb7626a835423c7dd5 (diff)
downloadbcm5719-llvm-1ef654024f490b403494265c968570ca6bd800f3.tar.gz
bcm5719-llvm-1ef654024f490b403494265c968570ca6bd800f3.zip
[X86] Don't give catch objects a displacement of zero
Catch objects with a displacement of zero do not initialize a catch object. The displacement is relative to %rsp at the end of the function's prologue for x86_64 targets. If we place an object at the top-of-stack, we will end up wit a displacement of zero resulting in our catch object remaining uninitialized. Address this by creating our catch objects as fixed objects. We will ensure that the UnwindHelp object is created after the catch objects so that no catch object will have a displacement of zero. Differential Revision: http://reviews.llvm.org/D17823 llvm-svn: 262546
Diffstat (limited to 'llvm/lib/CodeGen/StackColoring.cpp')
-rw-r--r--llvm/lib/CodeGen/StackColoring.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/StackColoring.cpp b/llvm/lib/CodeGen/StackColoring.cpp
index 984ce470c6f..852db5d2a01 100644
--- a/llvm/lib/CodeGen/StackColoring.cpp
+++ b/llvm/lib/CodeGen/StackColoring.cpp
@@ -249,11 +249,13 @@ unsigned StackColoring::collectMarkers(unsigned NumSlot) {
MI.getOpcode() != TargetOpcode::LIFETIME_END)
continue;
- Markers.push_back(&MI);
-
bool IsStart = MI.getOpcode() == TargetOpcode::LIFETIME_START;
const MachineOperand &MO = MI.getOperand(0);
- unsigned Slot = MO.getIndex();
+ int Slot = MO.getIndex();
+ if (Slot < 0)
+ continue;
+
+ Markers.push_back(&MI);
MarkersFound++;
@@ -393,7 +395,8 @@ void StackColoring::calculateLiveIntervals(unsigned NumSlots) {
bool IsStart = MI->getOpcode() == TargetOpcode::LIFETIME_START;
const MachineOperand &Mo = MI->getOperand(0);
int Slot = Mo.getIndex();
- assert(Slot >= 0 && "Invalid slot");
+ if (Slot < 0)
+ continue;
SlotIndex ThisIndex = Indexes->getInstructionIndex(*MI);
OpenPOWER on IntegriCloud