[llvm] [bolt][aarch64] simplify rodata/literal load for X86 & AArch64 (PR #165723)
YongKang Zhu via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 1 08:57:29 PST 2025
================
@@ -1226,28 +1227,53 @@ bool SimplifyRODataLoads::simplifyRODataLoads(BinaryFunction &BF) {
}
// Get the contents of the section containing the target address of the
- // memory operand. We are only interested in read-only sections.
+ // memory operand. We are only interested in read-only sections for X86,
+ // for aarch64 the sections can be read-only or executable.
ErrorOr<BinarySection &> DataSection =
BC.getSectionForAddress(TargetAddress);
- if (!DataSection || DataSection->isWritable())
+ if (!DataSection)
----------------
yozhu wrote:
Sorry I missed this in my last review - I guess we want to skip this optimization if the target data is located inside a writeable section for all architectures.
https://github.com/llvm/llvm-project/pull/165723
More information about the llvm-commits
mailing list