[PATCH] D72215: [AArch64] Add function attribute "patchable-function-entry" to add NOPs at function entry

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 4 15:09:17 PST 2020


MaskRay created this revision.
MaskRay added reviewers: dberris, dmgreen, efriedma, nickdesaulniers, rnk, sanjoy.google, samparker.
Herald added subscribers: llvm-commits, hiraditya, kristof.beyls.
Herald added a project: LLVM.

The Linux kernel uses -fpatchable-function-entry to implement dynamic
ftrace for arm64 and parisc. GCC 8 implemented
-fpatchable-function-entry, which can be seen as a generalized form of
-mnop-mcount. The N,M form (function entry points before the Mth NOP) is
currently only used by parisc.

This patch adds N,0 support to AArch64 codegen. It reuses the existing patchable-function pass, and TargetOpcode::PATCHABLE_FUNCTION_ENTER which is currently used by XRay.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72215

Files:
  llvm/lib/CodeGen/PatchableFunction.cpp
  llvm/lib/IR/Verifier.cpp
  llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
  llvm/test/CodeGen/AArch64/patchable-function-entry.ll
  llvm/test/Verifier/invalid-patchable-function-entry.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72215.236205.patch
Type: text/x-patch
Size: 3956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200104/1220712e/attachment.bin>


More information about the llvm-commits mailing list