[llvm] [BOLT][AArch64] Add support for long absolute LLD thunks/veneers (PR #113408)
Peter Smith via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 6 02:55:42 PST 2024
================
@@ -1320,6 +1323,67 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
return 3;
}
+ /// Match the following pattern:
+ ///
+ /// LDR x16, .L1
+ /// BR x16
+ /// L1:
+ /// .quad Target
+ ///
+ /// Populate \p TargetAddress with the Target value on successful match.
+ bool matchAbsLongVeneer(const BinaryFunction &BF,
----------------
smithp35 wrote:
LLD will attempt to write veneers as "short" veneers whenever possible. This is true for all AArch64 LLD generated veneers. If the distance from the veneer to the target is < 128 MiB then LLD will use
`B target` instead of the sequence above. LLD won't change the name of the veneer when it does that.
I'd expect "short" veneers to be common for programs that are between 128 MiB and 256 MiB in size.
Maybe a possible enhancement to detect this case.
https://github.com/llvm/llvm-project/pull/113408
More information about the llvm-commits
mailing list