1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/include/llvm/CodeGen
Chandler Carruth 02eae91c4a [SLH] Introduce a new pass to do Speculative Load Hardening to mitigate
Spectre variant #1 for x86.

There is a lengthy, detailed RFC thread on llvm-dev which discusses the
high level issues. High level discussion is probably best there.

I've split the design document out of this patch and will land it
separately once I update it to reflect the latest edits and updates to
the Google doc used in the RFC thread.

This patch is really just an initial step. It isn't quite ready for
prime time and is only exposed via debugging flags. It has two major
limitations currently:
1) It only supports x86-64, and only certain ABIs. Many assumptions are
   currently hard-coded and need to be factored out of the code here.
2) It doesn't include any options for more fine-grained control, either
   of which control flow edges are significant or which loads are
   important to be hardened.
3) The code is still quite rough and the testing lighter than I'd like.

However, this is enough for people to begin using. I have had numerous
requests from people to be able to experiment with this patch to
understand the trade-offs it presents and how to use it. We would also
like to encourage work to similar effect in other toolchains.

The ARM folks are actively developing a system based on this for
AArch64. We hope to merge this with their efforts when both are far
enough along. But we also don't want to block making this available on
that effort.

Many thanks to the *numerous* people who helped along the way here. For
this patch in particular, both Eric and Craig did a ton of review to
even have confidence in it as an early, rough cut at this functionality.

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

llvm-svn: 336990
2018-07-13 11:13:58 +00:00
..
GlobalISel CodeGen: Remove pipeline dependencies on StackProtector; NFC 2018-07-13 00:08:38 +00:00
MIRParser Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
PBQP Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
AccelTable.h Revert "[AccelTable] Provide abstraction for emitting DWARF5 accelerator tables." 2018-07-10 16:18:56 +00:00
Analysis.h [WebAssembly] Add functions for EHScopes 2018-05-23 00:32:46 +00:00
AsmPrinter.h [DWARF] Rework debug line parsing to use llvm::Error and callbacks 2018-05-10 10:51:33 +00:00
AtomicExpandUtils.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
BasicTTIImpl.h [CostModel] Replace ShuffleKind::SK_Alternate with ShuffleKind::SK_Select (PR33744) 2018-06-12 16:12:29 +00:00
CalcSpillWeights.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
CallingConvLower.h [RISCV] Add custom CC_RISCV calling convention and improved call support 2017-12-11 12:49:02 +00:00
CommandFlags.inc Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
CostTable.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
DAGCombine.h
DFAPacketizer.h [Packetizer] Add function to check for aliasing between instructions 2017-10-20 22:08:40 +00:00
DIE.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
DIEValue.def
DwarfStringPoolEntry.h [DWARF][NFC] Overload AsmPrinter::emitDwarfStringOffsets() to take a DwarfStringPoolEntry 2018-01-11 02:35:00 +00:00
EdgeBundles.h
ExecutionDomainFix.h Separate LoopTraversal, ReachingDefAnalysis and BreakFalseDeps into their own files. 2018-01-22 10:06:50 +00:00
ExpandReductions.h Add a late IR expansion pass for the experimental reduction intrinsics. 2017-05-10 09:42:49 +00:00
FastISel.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
FaultMaps.h Fix FaultMaps crash when the out streamer is reused 2017-10-17 11:44:34 +00:00
FunctionLoweringInfo.h [FastISel] Sink local value materializations to first use 2018-03-14 21:54:21 +00:00
GCMetadata.h [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-07 23:53:32 +00:00
GCMetadataPrinter.h [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-07 23:53:32 +00:00
GCs.h
GCStrategy.h [Docs] Escape the @ symbol, so that it appears in documentation output. [NFC] 2018-04-26 21:55:45 +00:00
IntrinsicLowering.h [CodeGen] fix documentation comments; NFC 2017-12-15 18:09:33 +00:00
ISDOpcodes.h Get rid of SETCCE 2018-06-04 18:36:22 +00:00
LatencyPriorityQueue.h IWYU for llvm-config.h in llvm, additions. 2018-04-30 14:59:11 +00:00
LazyMachineBlockFrequencyInfo.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
LexicalScopes.h Mark dump() methods as const. NFC 2017-06-21 22:19:17 +00:00
LinkAllAsmWriterComponents.h
LinkAllCodegenComponents.h
LiveInterval.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
LiveIntervals.h Account for undef values from predecessors in extendSegmentsToUses 2018-06-26 14:37:16 +00:00
LiveIntervalUnion.h [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-05-24 23:10:29 +00:00
LivePhysRegs.h [BranchFolding] Fix live-in's when hoisting code 2018-06-07 07:20:33 +00:00
LiveRangeEdit.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
LiveRegMatrix.h Take into account the cost of local intervals when selecting split candidate. 2018-01-31 13:31:08 +00:00
LiveRegUnits.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
LiveStacks.h LiveStacks: Rename LiveStack.{h|cpp} to LiveStacks.{h|cpp}; NFC 2017-12-18 23:19:44 +00:00
LiveVariables.h Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
LoopTraversal.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
LowLevelType.h
MachineBasicBlock.h [SLH] Introduce a new pass to do Speculative Load Hardening to mitigate 2018-07-13 11:13:58 +00:00
MachineBlockFrequencyInfo.h Irreducible loop metadata for more accurate block frequency under PGO. 2017-11-02 22:26:51 +00:00
MachineBranchProbabilityInfo.h
MachineCombinerPattern.h [AArch64] Add patterns to replace fsub fmul with fma fneg. 2017-12-06 22:48:36 +00:00
MachineConstantPool.h Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
MachineDominanceFrontier.h [WebAssembly] Add WebAssemblyException information analysis 2018-06-25 01:20:21 +00:00
MachineDominators.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
MachineFrameInfo.h CodeGen: Remove pipeline dependencies on StackProtector; NFC 2018-07-13 00:08:38 +00:00
MachineFunction.h [WebAssembly] Add WasmEHFuncInfo for unwind destination information 2018-06-19 00:26:39 +00:00
MachineFunctionPass.h Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MachineInstr.h [NFC] make MIFlag accessor functions consistant with usage model 2018-06-18 18:37:48 +00:00
MachineInstrBuilder.h [DebugInfo] Make sure all DBG_VALUEs' reguse operands have IsDebug property 2018-06-21 10:03:34 +00:00
MachineInstrBundle.h [CodeGen] Use MachineOperand::print in the MIRPrinter for MO_Register. 2017-12-07 10:40:31 +00:00
MachineInstrBundleIterator.h [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-05-31 01:10:10 +00:00
MachineJumpTableInfo.h [CodeGen] Print jump-table index operands as %jump-table.0 in both MIR and debug output 2017-12-13 10:30:59 +00:00
MachineLoopInfo.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
MachineMemOperand.h Fix type mismatch between MachineMemOperand constructor and accessors. NFC 2018-04-09 18:42:19 +00:00
MachineModuleInfo.h MachineModuleInfo: Remove unused function; NFC 2017-12-15 22:22:42 +00:00
MachineModuleInfoImpls.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-10 22:33:29 +00:00
MachineOperand.h Reapplying r331819 [GlobalISel][Legalizer] More concise and faster widenScalar, NFC 2018-05-09 17:28:18 +00:00
MachineOptimizationRemarkEmitter.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
MachineOutliner.h [MachineOutliner] Assert that Liveness tracking is accurate (NFC) 2018-07-07 08:02:19 +00:00
MachinePassRegistry.h [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-26 22:44:03 +00:00
MachinePostDominators.h [Dominators] Change Roots type to SmallVector 2017-07-26 18:27:39 +00:00
MachineRegionInfo.h [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-01 23:25:02 +00:00
MachineRegisterInfo.h [GlobalISel] NFCI, Getting GlobalISel ~5% faster 2018-05-23 21:12:02 +00:00
MachineScheduler.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
MachineSSAUpdater.h [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-09-11 23:00:48 +00:00
MachineTraceMetrics.h Recommit [MachineCombiner] Update instruction depths incrementally for large BBs. 2017-09-20 11:54:37 +00:00
MachORelocation.h
MacroFusion.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
MIRPrinter.h MIParser/MIRPrinter: Compute block successors if not explicitely specified 2017-05-05 21:09:30 +00:00
MIRYamlMapping.h [MIR] Add support for debug metadata for fixed stack objects 2018-04-25 18:58:06 +00:00
ParallelCG.h
Passes.h [MachineOutliner] Add support for target-default outlining. 2018-06-30 03:56:03 +00:00
PBQPRAConstraint.h Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
PreISelIntrinsicLowering.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-09-13 21:15:20 +00:00
PseudoSourceValue.h Add AddresSpace to PseudoSourceValue. 2017-09-14 20:53:51 +00:00
ReachingDefAnalysis.h [ReachingDefAnalysis] Fix what I assume to be a typo ReachingDedDefaultVal->ReachingDefDefaultVal. 2018-03-20 20:53:21 +00:00
RegAllocPBQP.h Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
RegAllocRegistry.h [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-07 23:53:32 +00:00
RegisterClassInfo.h Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
RegisterPressure.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
RegisterScavenging.h RegScavenging: Add scavengeRegisterBackwards() 2017-06-17 02:08:18 +00:00
RegisterUsageInfo.h RegisterUsageInfo.h: Add missing header for complete type needed for DenseMap traits 2017-10-24 21:29:10 +00:00
ResourcePriorityQueue.h Fix a bunch more layering of CodeGen headers that are in Target 2017-11-17 01:07:10 +00:00
RuntimeLibcalls.def Add support for emitting libcalls for x86_fp80 -> fp128 and vice-versa 2018-01-17 22:29:16 +00:00
RuntimeLibcalls.h [IR][CodeGen] Remove dependency on EVT from IR/Function.cpp. Move EVT to CodeGen layer. 2018-03-29 17:21:10 +00:00
ScheduleDAG.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
ScheduleDAGInstrs.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
ScheduleDAGMutation.h
ScheduleDFS.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
ScheduleHazardRecognizer.h
SchedulerRegistry.h [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-06 22:22:41 +00:00
ScoreboardHazardRecognizer.h
SDNodeProperties.td TableGen: Allow setting SDNodeProperties on intrinsics 2017-12-20 19:36:28 +00:00
SelectionDAG.h [SelectionDAG] Split float and integer isKnownNeverZero tests 2018-07-07 18:17:14 +00:00
SelectionDAGAddressAnalysis.h [DAG] Teach BaseIndexOffset to correctly handle with indexed operations 2018-01-08 16:21:35 +00:00
SelectionDAGISel.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
SelectionDAGNodes.h [SelectionDAG] Remove debug locations from ConstantSD(FP)Nodes 2018-06-25 17:06:18 +00:00
SelectionDAGTargetInfo.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-09-13 21:15:20 +00:00
SlotIndexes.h [DebugInfo] Examine all uses of isDebugValue() for debug instructions. 2018-05-09 02:42:00 +00:00
StackMaps.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
StackProtector.h CodeGen: Remove pipeline dependencies on StackProtector; NFC 2018-07-13 00:08:38 +00:00
TailDuplicator.h Remove unnecessary includes; NFC 2017-12-13 02:51:01 +00:00
TargetCallingConv.h [IR][CodeGen] Remove dependency on EVT from IR/Function.cpp. Move EVT to CodeGen layer. 2018-03-29 17:21:10 +00:00
TargetFrameLowering.h Correct dwarf unwind information in function epilogue 2018-04-24 10:32:08 +00:00
TargetInstrInfo.h [MachineOutliner] Fix typo in getOutliningCandidateInfo function name 2018-07-04 15:37:08 +00:00
TargetLowering.h [X86][TLI] DAGCombine: Unfold variable bit-clearing mask to two shifts. 2018-07-09 19:06:42 +00:00
TargetLoweringObjectFileImpl.h Revert "Add support for generating a call graph profile from Branch Frequency Info." 2018-06-28 13:15:03 +00:00
TargetOpcodes.h Fix layering of CodeGen/TargetOpcodes.def by moving it to Support 2018-03-23 23:58:27 +00:00
TargetPassConfig.h Fix typos of occurred and occurrence 2018-01-24 10:33:39 +00:00
TargetRegisterInfo.h GlobalISel: Use a callback to compute constrained reg class for unallocatble registers 2018-05-03 21:44:16 +00:00
TargetSchedule.h [CodeGen] assume max/default throughput for unspecified instructions 2018-06-05 23:34:45 +00:00
TargetSubtargetInfo.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
UnreachableBlockElim.h
ValueTypes.h [IR][CodeGen] Remove dependency on EVT from IR/Function.cpp. Move EVT to CodeGen layer. 2018-03-29 17:21:10 +00:00
ValueTypes.td NFC Fix a comment in ValueTypes.td 2018-06-07 23:32:18 +00:00
VirtRegMap.h Remove @brief commands from doxygen comments, too. 2018-05-01 16:10:38 +00:00
WasmEHFuncInfo.h Fix WasmEHFuncInfo.h to include what it uses 2018-06-20 21:43:49 +00:00
WinEHFuncInfo.h [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-03 00:22:41 +00:00