1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/include/llvm
Peter Collingbourne 1834ad0e4a Use branch funnels for virtual calls when retpoline mitigation is enabled.
The retpoline mitigation for variant 2 of CVE-2017-5715 inhibits the
branch predictor, and as a result it can lead to a measurable loss of
performance. We can reduce the performance impact of retpolined virtual
calls by replacing them with a special construct known as a branch
funnel, which is an instruction sequence that implements virtual calls
to a set of known targets using a binary tree of direct branches. This
allows the processor to speculately execute valid implementations of the
virtual function without allowing for speculative execution of of calls
to arbitrary addresses.

This patch extends the whole-program devirtualization pass to replace
certain virtual calls with calls to branch funnels, which are
represented using a new llvm.icall.jumptable intrinsic. It also extends
the LowerTypeTests pass to recognize the new intrinsic, generate code
for the branch funnels (x86_64 only for now) and lay out virtual tables
as required for each branch funnel.

The implementation supports full LTO as well as ThinLTO, and extends the
ThinLTO summary format used for whole-program devirtualization to
support branch funnels.

For more details see RFC:
http://lists.llvm.org/pipermail/llvm-dev/2018-January/120672.html

Differential Revision: https://reviews.llvm.org/D42453

llvm-svn: 327163
2018-03-09 19:11:44 +00:00
..
ADT Use branch funnels for virtual calls when retpoline mitigation is enabled. 2018-03-09 19:11:44 +00:00
Analysis [NFC] Factor out a helper function for checking if a block has a potential early implicit exit. 2018-03-08 21:25:30 +00:00
AsmParser LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00
BinaryFormat [DWARF v5] Support for verbose dumping of .debug_rnglist entries 2018-03-08 20:52:35 +00:00
Bitcode bitcode support change for fast flags compatibility 2018-02-19 19:22:28 +00:00
CodeGen Use branch funnels for virtual calls when retpoline mitigation is enabled. 2018-03-09 19:11:44 +00:00
Config Fix cmake's multi-config generators after r326738 2018-03-07 19:32:36 +00:00
DebugInfo [DebugInfo/AccelTable] Fix inconsistency in getDIEOffset implementations 2018-03-09 11:58:59 +00:00
Demangle
ExecutionEngine [ORC] Switch to shared_ptr ownership for SymbolSources in VSOs. 2018-02-21 21:55:57 +00:00
FuzzMutate [llvm-opt-fuzzer] Avoid adding incorrect inputs to the fuzzer corpus 2018-02-05 11:05:47 +00:00
IR Use branch funnels for virtual calls when retpoline mitigation is enabled. 2018-03-09 19:11:44 +00:00
IRReader LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00
LineEditor
Linker Revert "[IRMover] Implement name based structure type mapping" 2018-02-21 20:12:18 +00:00
LTO Revert "[LTO] Support filtering by hotness threshold" 2018-03-08 01:13:10 +00:00
MC Delay creating an alias for @@@. 2018-03-09 18:42:25 +00:00
Object [WebAssembly] Add validation to reloc section 2018-03-05 13:32:38 +00:00
ObjectYAML [WebAssembly] Fix broken gcc build after rL326454 2018-03-01 18:48:08 +00:00
Option [COFF] Process /EXPORT option in fastpath 2018-01-09 20:36:42 +00:00
Passes NewPM: Add an extension point for the start of the pipeline. 2018-01-23 01:25:20 +00:00
ProfileData Fix Wdocumentation warning - remove param tag for old argument 2018-02-22 13:28:42 +00:00
Support [Support] Move syntax highlighting into support 2018-03-09 09:56:24 +00:00
TableGen TableGen: Add a defset statement 2018-03-09 12:24:42 +00:00
Target Use branch funnels for virtual calls when retpoline mitigation is enabled. 2018-03-09 19:11:44 +00:00
Testing/Support [Testing/Support] Make the HasValue matcher composable 2017-12-13 10:00:38 +00:00
ToolDrivers llvm: add llvm-dlltool support to the archiver 2017-07-18 21:26:38 +00:00
Transforms [InstrProfiling] Emit the runtime hook when no counters are lowered 2018-02-28 19:00:08 +00:00
WindowsManifest Fix bug 34608 by moving private header out of public header. 2017-09-14 23:01:13 +00:00
WindowsResource [llvm-readobj] Teach readobj to dump .res files (WindowsResource). 2017-09-20 18:33:35 +00:00
XRay XRayRecord.h: Add missing #include 2017-11-21 00:23:19 +00:00
CMakeLists.txt
InitializePasses.h Another try to commit 323321 (aggressive instruction combine). 2018-01-25 12:06:32 +00:00
LinkAllIR.h Sink some IntrinsicInst.h and Intrinsics.h out of llvm/include 2017-09-07 23:27:44 +00:00
LinkAllPasses.h Rename CountingFunctionInserter and use for both mcount and cygprofile calls, before and after inlining 2017-11-14 21:09:45 +00:00
module.modulemap [WebAssembly] Remove unneeded sub-directory 2017-12-21 03:16:34 +00:00
module.modulemap.build [Modules] Add module for Config/llvm-config.h 2017-10-24 06:18:52 +00:00
Pass.h IR printing improvement for function passes - introducing -print-module-scope 2017-12-01 17:42:46 +00:00
PassAnalysisSupport.h [NFC] fix trivial typos in comments 2018-01-23 05:49:30 +00:00
PassInfo.h [Pass] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-09-06 23:05:38 +00:00
PassRegistry.h [Pass] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-09-06 23:05:38 +00:00
PassSupport.h [Pass] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-09-06 23:05:38 +00:00