[PATCH] D49884: [MachineOutliner] Add support for saving LR to a callee-saved register

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 26 16:23:22 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Target/AArch64/AArch64InstrInfo.cpp:4929
+///                                   I3
+///                                   RET
+///
----------------
An alternative sequence would be "ADR scratch, .+8; B OUTLINED_FUNCTION", and then in the outlined function "I1; I2; I3; BR scratch".  Disadvantage is that every caller has to use the same register, and I guess you can't skip the save/restore in some callers like you're planning.


================
Comment at: lib/Target/AArch64/AArch64InstrInfo.cpp:4952
+  // We only want callee-saved registers that were saved in the Candidate's
+  // frame.
+  const std::vector<CalleeSavedInfo> &CSInfo =
----------------
Why not a caller-save register?


https://reviews.llvm.org/D49884





More information about the llvm-commits mailing list