1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/include/llvm/Target
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
..
GlobalISel [GlobalISel][TableGen] Add support for SDNodeXForm 2018-01-16 18:44:05 +00:00
GenericOpcodes.td GlobalISel: IRTranslate llvm.fabs.* intrinsic 2018-03-05 22:31:55 +00:00
Target.td Use branch funnels for virtual calls when retpoline mitigation is enabled. 2018-03-09 19:11:44 +00:00
TargetCallingConv.td
TargetIntrinsicInfo.h
TargetItinerary.td [NFC] Fix comment of class InstrStage 2018-02-12 15:02:49 +00:00
TargetMachine.h [TLS] use emulated TLS if the target supports only this mode 2018-02-28 17:48:55 +00:00
TargetOptions.h [TLS] use emulated TLS if the target supports only this mode 2018-02-28 17:48:55 +00:00
TargetSchedule.td [TargetSchedule] Expose sub-units of a ProcResGroup in MCProcResourceDesc. 2018-02-08 08:46:48 +00:00
TargetSelectionDAG.td [AArch64] Improve v8.1-A code-gen for atomic load-and 2018-02-12 17:03:11 +00:00