1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/lib/IR
Fangrui Song f36616f7db [AArch64] Add function attribute "patchable-function-entry" to add NOPs at function entry
The Linux kernel uses -fpatchable-function-entry to implement DYNAMIC_FTRACE_WITH_REGS
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. N is represented as the
function attribute "patchable-function-entry". We will use a different
function attribute for M, if we decide to implement it.

The patch reuses the existing patchable-function pass, and
TargetOpcode::PATCHABLE_FUNCTION_ENTER which is currently used by XRay.

When the integrated assembler is used, __patchable_function_entries will
be created for each text section with the SHF_LINK_ORDER flag to prevent
--gc-sections (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93197) and
COMDAT (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93195) issues.

Retrospectively, __patchable_function_entries should use a PC-relative
relocation type to avoid the SHF_WRITE flag and dynamic relocations.

"patchable-function-entry"'s interaction with Branch Target
Identification is still unclear (see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424 for GCC discussions).

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D72215
2020-01-10 09:55:51 -08:00
..
AbstractCallSite.cpp [Attributor] Use abstract call sites to determine associated arguments 2019-12-31 01:33:22 -06:00
AsmWriter.cpp OpaquePtr: print byval types containing anonymous types correctly. 2020-01-07 15:11:43 +00:00
AttributeImpl.h
Attributes.cpp
AttributesCompatFunc.td
AutoUpgrade.cpp Add Triple::isX86() 2020-01-06 15:51:02 -08:00
BasicBlock.cpp
CMakeLists.txt
Comdat.cpp
ConstantFold.cpp
ConstantFold.h
ConstantRange.cpp [ConstantRange] Respect destination bitwidth for cast results. 2019-12-27 17:38:34 +00:00
Constants.cpp
ConstantsContext.h
Core.cpp IR: remove "else" after "return". NFCI. 2020-01-09 15:00:54 +00:00
DataLayout.cpp
DebugInfo.cpp reland "[DebugInfo] Support to emit debugInfo for extern variables" 2019-12-22 18:28:50 -08:00
DebugInfoMetadata.cpp Rename DW_AT_LLVM_isysroot to DW_AT_LLVM_sysroot 2019-12-20 13:11:17 -08:00
DebugLoc.cpp
DiagnosticHandler.cpp
DiagnosticInfo.cpp
DiagnosticPrinter.cpp
DIBuilder.cpp Fix case style warnings in DIBuilder. NFC. 2019-12-23 07:27:18 +00:00
Dominators.cpp
FPEnv.cpp
Function.cpp
Globals.cpp
GVMaterializer.cpp
InlineAsm.cpp
Instruction.cpp
Instructions.cpp
IntrinsicInst.cpp
IRBuilder.cpp [Alignment][NFC] Align compatible methods for CreateElementUnorderedAtomicMemSet 2019-12-19 20:03:35 +01:00
IRPrintingPasses.cpp
LegacyPassManager.cpp
LLVMBuild.txt
LLVMContext.cpp
LLVMContextImpl.cpp
LLVMContextImpl.h Rename DW_AT_LLVM_isysroot to DW_AT_LLVM_sysroot 2019-12-20 13:11:17 -08:00
Mangler.cpp
MDBuilder.cpp
Metadata.cpp [Metadata] Add TBAA struct metadata to AAMDNode 2020-01-06 11:05:15 +03:00
MetadataImpl.h
Module.cpp
ModuleSummaryIndex.cpp
Operator.cpp
OptBisect.cpp
Pass.cpp
PassInstrumentation.cpp
PassManager.cpp
PassRegistry.cpp
PassTimingInfo.cpp
ProfileSummary.cpp
RemarkStreamer.cpp
SafepointIRVerifier.cpp
Statepoint.cpp
SymbolTableListTraitsImpl.h
Type.cpp
TypeFinder.cpp [NFC] Fixes -Wrange-loop-analysis warnings 2020-01-01 20:01:37 +01:00
Use.cpp
User.cpp
Value.cpp
ValueSymbolTable.cpp
Verifier.cpp [AArch64] Add function attribute "patchable-function-entry" to add NOPs at function entry 2020-01-10 09:55:51 -08:00