[PATCH] D69097: [AArch64][MachineOutliner] Return address signing for outlined functions

Oliver Stannard (Linaro) via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 06:16:44 PDT 2019


ostannard added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:5129
+  if (FCF.hasFnAttribute("sign-return-address")) {
+    NumBytesToCreateFrame += 8;
+  }
----------------
tellenbach wrote:
> This is actually an assumption: If the candidates agree on `"sign-return-address"="non-leaf"`, the outlined function could potentially get signed. (and the outlined function could potentially increase by two instructions). However, it is not certainly true that it will be no leaf function (and hence needs no signing), This gets determined later when the decision to outline or not is already made.
I think this would be useful as a comment.

Could we also check if we have the v8.3A instructions here, as using RETAA will reduce the size bloat by 4 bytes?


================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:5064
+
+  // If function B doesn't have the "sign-return-address" attribute but A does,
+  // the function's signing behaviour is equal if B's value for
----------------
This comment doesn't make sense, I think you swapped A and B half way through.


================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:5079
+
+  return false;
+}
----------------
I think this can be `llvm_unreachable`, the above code covers all possible combinations.


================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:5120
+
+  return false;
+}
----------------
`llvm_unreachable`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69097





More information about the llvm-commits mailing list