[FastISel] Fix insertion of unconditional branches during FastISel
authorDavid Tellenbach <david.tellenbach@arm.com>
Fri, 20 Sep 2019 13:22:59 +0000 (13:22 +0000)
committerDavid Tellenbach <david.tellenbach@arm.com>
Fri, 20 Sep 2019 13:22:59 +0000 (13:22 +0000)
commit2a47c77e720a24f808bf6230d0a56bc969258b86
treee44515f084cfca1a9b4ffbcfcda0bfc3ec05b488
parent4a13c828f6d78e49eabffc7b57f805ca46a2a827
[FastISel] Fix insertion of unconditional branches during FastISel

The insertion of an unconditional branch during FastISel can differ depending on
building with or without debug information. This happens because FastISel::fastEmitBranch
emits an unconditional branch depending on the size of the current basic block
without distinguishing between debug and non-debug instructions.

This patch fixes this issue by ignoring debug instructions when getting the size
of the basic block.

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: ormris, aprantl, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372389
llvm/include/llvm/IR/BasicBlock.h
llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
llvm/lib/IR/BasicBlock.cpp
llvm/test/CodeGen/AArch64/fast-isel-branch-uncond-debug.ll [new file with mode: 0644]
llvm/unittests/IR/BasicBlockTest.cpp