diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-03-27 18:14:02 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-03-27 18:14:02 +0000 |
commit | 2e9ddcc30e846687c9c0112d3ae32acccc9757bb (patch) | |
tree | b654e744a20f8be6bf3993f19493beaaeb03dbca /llvm/lib/CodeGen/RegisterPressure.cpp | |
parent | 24812d8ac42e0c11f9c185282e4e4cc1d9b067a6 (diff) | |
download | bcm5719-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.cpp | 8 |
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; |