]> granicus.if.org Git - llvm/commit
[mips] Fix PR35071
authorSimon Dardis <simon.dardis@mips.com>
Thu, 26 Oct 2017 10:58:36 +0000 (10:58 +0000)
committerSimon Dardis <simon.dardis@mips.com>
Thu, 26 Oct 2017 10:58:36 +0000 (10:58 +0000)
commit46690e4aa0b197b7576af99c7b4c6b753de4cdd8
treeadb90f539c0594c600c05f4d224910fa000cbc3d
parentb723ea0a40fa4b643d5422e84b797905408909dd
[mips] Fix PR35071

PR35071 exposed the fact that MipsInstrInfo::removeBranch did not walk past
debug instructions when removing branches for the control flow optimizer, which
lead to duplicated conditional branches. If the target of the branch was a
removable block, only the conditional branch in the terminating position would
have it's MBB operands updated, leaving the first branch with a dangling MBB
operand. The MIPS long branch pass would then trigger an assertion when
attempting to examine the instruction with dangling MBB operand.

This resolves PR35071.

Thanks to Alex Richardson for reporting the issue!

Reviewers: atanasyan

Differential Revision: https://reviews.llvm.org/D39288

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316654 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsInstrInfo.cpp
test/CodeGen/Mips/pr35071.ll [new file with mode: 0644]