summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterPressure.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-03-27 18:14:02 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-03-27 18:14:02 +0000
commit2e9ddcc30e846687c9c0112d3ae32acccc9757bb (patch)
treeb654e744a20f8be6bf3993f19493beaaeb03dbca /llvm/lib/CodeGen/RegisterPressure.cpp
parent24812d8ac42e0c11f9c185282e4e4cc1d9b067a6 (diff)
downloadbcm5719-llvm-2e9ddcc30e846687c9c0112d3ae32acccc9757bb.tar.gz
bcm5719-llvm-2e9ddcc30e846687c9c0112d3ae32acccc9757bb.zip
RegPressure: Fix crash on blocks with only dbg_value
If there were only dbg_values in the block, recede would hit the beginning of the block and try to use thet dbg_value as a real instruction. llvm-svn: 357105
Diffstat (limited to 'llvm/lib/CodeGen/RegisterPressure.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterPressure.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegisterPressure.cpp b/llvm/lib/CodeGen/RegisterPressure.cpp
index dafd95fa7d5..7d9b3aa9b2d 100644
--- a/llvm/lib/CodeGen/RegisterPressure.cpp
+++ b/llvm/lib/CodeGen/RegisterPressure.cpp
@@ -845,7 +845,7 @@ void RegPressureTracker::recedeSkipDebugValues() {
CurrPos = skipDebugInstructionsBackward(std::prev(CurrPos), MBB->begin());
SlotIndex SlotIdx;
- if (RequireIntervals)
+ if (RequireIntervals && !CurrPos->isDebugInstr())
SlotIdx = LIS->getInstructionIndex(*CurrPos).getRegSlot();
// Open the top of the region using slot indexes.
@@ -855,6 +855,12 @@ void RegPressureTracker::recedeSkipDebugValues() {
void RegPressureTracker::recede(SmallVectorImpl<RegisterMaskPair> *LiveUses) {
recedeSkipDebugValues();
+ if (CurrPos->isDebugValue()) {
+ // It's possible to only have debug_value instructions and hit the start of
+ // the block.
+ assert(CurrPos == MBB->begin());
+ return;
+ }
const MachineInstr &MI = *CurrPos;
RegisterOperands RegOpers;
OpenPOWER on IntegriCloud