[llvm] [BOLT][AArch64] Fix ADR relaxation (PR #71835)

Vladislav Khmelevsky via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 9 10:44:57 PST 2023


================
@@ -56,9 +56,13 @@ void ADRRelaxationPass::runOnFunction(BinaryFunction &BF) {
           continue;
       }
 
-      BinaryFunction *TargetBF = BC.getFunctionForSymbol(Symbol);
-      if (TargetBF && TargetBF == &BF)
-        continue;
+      // Don't relax adr if it points to the same function and it is not split
+      // and BF initial size is < 1MB.
+      if (!BF.isSplit() && BF.getSize() < 0x100000) {
----------------
yota9 wrote:

Moved to separate constant, I think it is OK, isn't it?

https://github.com/llvm/llvm-project/pull/71835


More information about the llvm-commits mailing list