Changes
Summary
- [XRay] Create an Index of sleds per function Summary: This change adds a new section to the xray-instrumented binary that stores an index into ranges of the instrumentation map, where sleds associated with the same function can be accessed as an array. At runtime, we can get access to this index by function ID offset allowing for selective patching and unpatching by function ID. Each entry in this new section (xray_fn_idx) will include two pointers indicating the start and one past the end of the sleds associated with the same function. These entries will be 16 bytes long on x86 and aarch64. On arm, we align to 16 bytes anyway so the runtime has to take that into consideration. __{start,stop}_xray_fn_idx will be the symbols that the runtime will look for when we implement the selective patching/unpatching by function id APIs. Because XRay synthesizes the function id's in a monotonically increasing manner at runtime now, implementations (and users) can use this table to look up the sleds associated with a specific function. This is useful in implementations that want to do things like: - Implement coverage mode for functions by patching everything pre-main, then as functions are encountered, the installed handler can unpatch the function that's been encountered after recording that it's been called. - Do "learning mode", so that the implementation can figure out some statistical information about function calls by function id for a time being, and then determine which functions are worth uninstrumenting at runtime. - Do "selective instrumentation" where an implementation can specifically instrument only certain function id's at runtime (either based on some external data, or through some other heuristics) instead of patching all the instrumented functions at runtime. Reviewers: dblaikie, echristo, chandlerc, javed.absar Subscribers: pelikan, aemerson, kpw, llvm-commits, rengolin Differential Revision: https://reviews.llvm.org/D32693
- IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI. When profiling a no-op incremental link of Chromium I found that the functions computeImportForFunction and computeDeadSymbols were consuming roughly 10% of the profile. The goal of this change is to improve the performance of those functions by changing the map lookups that they were previously doing into pointer dereferences. This is achieved by changing the ValueInfo data structure to be a pointer to an element of the global value map owned by ModuleSummaryIndex, and changing reference lists in the GlobalValueSummary to hold ValueInfos instead of GUIDs. This means that a ValueInfo will take a client directly to the summary list for a given GUID. Differential Revision: https://reviews.llvm.org/D32471
Change Type | Path in Repository | Path in Workspace |
---|---|---|
![]() | /llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (diff) | llvm-revision.src/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h |
![]() | /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (diff) | llvm-revision.src/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp |
![]() | /llvm/trunk/test/CodeGen/AArch64/xray-attribute-instrumentation.ll (diff) | llvm-revision.src/llvm/trunk/test/CodeGen/AArch64/xray-attribute-instrumentation.ll |
![]() | /llvm/trunk/test/CodeGen/AArch64/xray-tail-call-sled.ll (diff) | llvm-revision.src/llvm/trunk/test/CodeGen/AArch64/xray-tail-call-sled.ll |
![]() | /llvm/trunk/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll (diff) | llvm-revision.src/llvm/trunk/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll |
![]() | /llvm/trunk/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll (diff) | llvm-revision.src/llvm/trunk/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll |
![]() | /llvm/trunk/test/CodeGen/X86/xray-attribute-instrumentation.ll (diff) | llvm-revision.src/llvm/trunk/test/CodeGen/X86/xray-attribute-instrumentation.ll |
![]() | /llvm/trunk/test/CodeGen/X86/xray-tail-call-sled.ll (diff) | llvm-revision.src/llvm/trunk/test/CodeGen/X86/xray-tail-call-sled.ll |
Change Type | Path in Repository | Path in Workspace |
![]() | /cfe/trunk/lib/CodeGen/BackendUtil.cpp (diff) | llvm-revision.src/cfe/trunk/lib/CodeGen/BackendUtil.cpp |
![]() | /llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h (diff) | llvm-revision.src/llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h |
![]() | /llvm/trunk/include/llvm/IR/ModuleSummaryIndexYAML.h (diff) | llvm-revision.src/llvm/trunk/include/llvm/IR/ModuleSummaryIndexYAML.h |
![]() | /llvm/trunk/lib/Analysis/ModuleSummaryAnalysis.cpp (diff) | llvm-revision.src/llvm/trunk/lib/Analysis/ModuleSummaryAnalysis.cpp |
![]() | /llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (diff) | llvm-revision.src/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp |
![]() | /llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (diff) | llvm-revision.src/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp |
![]() | /llvm/trunk/lib/IR/ModuleSummaryIndex.cpp (diff) | llvm-revision.src/llvm/trunk/lib/IR/ModuleSummaryIndex.cpp |
![]() | /llvm/trunk/lib/LTO/LTO.cpp (diff) | llvm-revision.src/llvm/trunk/lib/LTO/LTO.cpp |
![]() | /llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp (diff) | llvm-revision.src/llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp |
![]() | /llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp (diff) | llvm-revision.src/llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp |
![]() | /llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp (diff) | llvm-revision.src/llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp |
![]() | /llvm/trunk/lib/Transforms/IPO/WholeProgramDevirt.cpp (diff) | llvm-revision.src/llvm/trunk/lib/Transforms/IPO/WholeProgramDevirt.cpp |
![]() | /llvm/trunk/tools/llvm-link/llvm-link.cpp (diff) | llvm-revision.src/llvm/trunk/tools/llvm-link/llvm-link.cpp |
![]() | /llvm/trunk/tools/llvm-lto/llvm-lto.cpp (diff) | llvm-revision.src/llvm/trunk/tools/llvm-lto/llvm-lto.cpp |