[PATCH] D145211: Relax cross-section branches

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 17:06:42 PDT 2023


efriedma added a comment.

> Unconditional branches are relaxed via thunk insertion by the linker, but conditional branches must be manually relaxed. Because of this, we should assume that any cross-sectional conditional jumps are out of range

As-is, it looks like this patch is also relaxing cross-sectional unconditional jumps.  Given we can trust the linker to relax these, and we expect the branches to be cold, is there a reason for the compiler to relax them?  I guess the linker-generated stub could clobber x16/x17?



================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:287
+      .addReg(Reg)
+      .addReg(AArch64::SP)
+      .addImm(-16);
----------------
Do we know at this point that the function isn't using the red zone?  (We usually use the emergency spill slot for this sort of situation.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145211/new/

https://reviews.llvm.org/D145211



More information about the llvm-commits mailing list