Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 3d785e7

Browse files
author
Stefan Maksimovic
committed
[DebugInfo] Don't insert DEBUG_VALUE after terminators
r314974 introduced insertion of DEBUG_VALUEs after each redefinition of debug value register in the slot index range. In case the instruction redefining the debug value register was a terminator, machine verifier would complain since it enforces the rule of no non-terminator instructions following the first terminator. Differential Revision: https://reviews.llvm.org/D42801 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324734 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 1e20442 commit 3d785e7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/CodeGen/LiveDebugVariables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ findNextInsertLocation(MachineBasicBlock *MBB,
10971097
unsigned Reg = LocMO.getReg();
10981098

10991099
// Find the next instruction in the MBB that define the register Reg.
1100-
while (I != MBB->end()) {
1100+
while (I != MBB->end() && !I->isTerminator()) {
11011101
if (!LIS.isNotInMIMap(*I) &&
11021102
SlotIndex::isEarlierEqualInstr(StopIdx, LIS.getInstructionIndex(*I)))
11031103
break;

test/CodeGen/Mips/pr34975.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc -mtriple=mips64-unknown-freebsd -target-abi n64 -relocation-model pic -o /dev/null %s -O2
1+
; RUN: llc -mtriple=mips64-unknown-freebsd -target-abi n64 -relocation-model pic -verify-machineinstrs -o /dev/null %s -O2
22

33
; Test that the presence of debug information does not cause the branch folder
44
; to rewrite branches to have negative basic block ids, which would cause the

test/CodeGen/Mips/pr35071.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc -mtriple mips64-unknown-freebsd12.0 -relocation-model pic -mcpu=mips4 -target-abi n64 -O2 -o - %s
1+
; RUN: llc -mtriple mips64-unknown-freebsd12.0 -relocation-model pic -mcpu=mips4 -target-abi n64 -O2 -verify-machineinstrs -o - %s
22

33
; Test that the long branch pass does not crash due to the control flow
44
; optimizer producing malformed basic block operands due to the backend

0 commit comments

Comments
 (0)