[AArch64InstrInfo] Stop getInstSizeInBytes returning non-zero for meta instructions.
authorPaul Walker <paul.walker@arm.com>
Fri, 16 Aug 2019 17:29:53 +0000 (17:29 +0000)
committerPaul Walker <paul.walker@arm.com>
Fri, 16 Aug 2019 17:29:53 +0000 (17:29 +0000)
commit2632c677f85cba1ac2aef5d68aaf8af0f5b3c944
tree9075736dd44e55c25bde501db4a1c9b5135f4d86
parent19301d75f086caae1a495d267f5d0264b225942d
[AArch64InstrInfo] Stop getInstSizeInBytes returning non-zero for meta instructions.

Recommit with fixes for mac builders.

Summary:
AArch64InstrInfo::getInstSizeInBytes is incorrectly treating meta
instructions (e.g. CFI_INSTRUCTION) as normal instructions and
giving them a size of 4.

This results in branch relaxation calculating block sizes wrong.
Branch relaxation also considers alignment and thus a single
mistake can result in later blocks being incorrectly sized even
when they themselves do not contain meta instructions.

The net result is we might not relax a branch whose destination is
not within range.

Reviewers: nickdesaulniers, peter.smith

Reviewed By: peter.smith

Subscribers: javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

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

> llvm-svn: 369111

llvm-svn: 369133
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/test/CodeGen/AArch64/branch-relax-block-size.mir [new file with mode: 0644]