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

Amir Ayupov via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 9 10:39:41 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) {
----------------
aaupov wrote:

Please avoid magic constants.

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


More information about the llvm-commits mailing list