]> granicus.if.org Git - llvm/commit
[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)
commit25e54c0ef9733de68961fe87b3c197d774da21b1
treea36ee9479641dba417e47c64177b6f7396504d3f
parent14d26bc59d3d5c9dc976eeda4984157ea37f3323
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369133 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64InstrInfo.cpp
test/CodeGen/AArch64/branch-relax-block-size.mir [new file with mode: 0644]