[AArch64] Support stackmap/patchpoint in getInstSizeInBytes
authorDiana Picus <diana.picus@linaro.org>
Tue, 13 Sep 2016 07:45:17 +0000 (07:45 +0000)
committerDiana Picus <diana.picus@linaro.org>
Tue, 13 Sep 2016 07:45:17 +0000 (07:45 +0000)
commit4b9728818400bfa1dfa7255dce9fafd9f1a04526
treeb8438c00f9c339435b763e203ed5c7dbaffef4cc
parent4619c9e6a8849163ef3fc812e832de0ae8c8e23f
[AArch64] Support stackmap/patchpoint in getInstSizeInBytes

We currently return 4 for stackmaps and patchpoints, which is very optimistic
and can in rare cases cause the branch relaxation pass to fail to relax certain
branches.

This patch causes getInstSizeInBytes to return a pessimistic estimate of the
size as the number of bytes requested in the stackmap/patchpoint. In the future,
we could provide a more accurate estimate by sharing some of the logic in
AArch64::LowerSTACKMAP/PATCHPOINT.

Fixes part of https://llvm.org/bugs/show_bug.cgi?id=28750

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

llvm-svn: 281301
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/test/CodeGen/MIR/AArch64/inst-size-patchpoint.mir [new file with mode: 0644]
llvm/test/CodeGen/MIR/AArch64/inst-size-stackmap.mir [new file with mode: 0644]