diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2018-07-24 12:19:01 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2018-07-24 12:19:01 +0000 |
| commit | 376113da89d0b32bfcbdfea6476ab441f4ef3537 (patch) | |
| tree | bc4b6770714843ac1c8c5ed3f8a6c030a0af6c71 /llvm/lib/Target | |
| parent | 8b93e82c3d60d16c868639687d1abe94b4c51c89 (diff) | |
| download | bcm5719-llvm-376113da89d0b32bfcbdfea6476ab441f4ef3537.tar.gz bcm5719-llvm-376113da89d0b32bfcbdfea6476ab441f4ef3537.zip | |
[x86/SLH] Tidy up a comment, using doxygen structure and wording it to
be more accurate and understandable.
llvm-svn: 337822
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp b/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp index c2453cef496..10e1132d877 100644 --- a/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp +++ b/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp @@ -1866,11 +1866,13 @@ bool X86SpeculativeLoadHardeningPass::canHardenRegister(unsigned Reg) { return RC->hasSuperClassEq(GPRRegClasses[Log2_32(RegBytes)]); } -// We can harden non-leaking loads into register without touching the address -// by just hiding all of the loaded bits. We use an `or` instruction to do -// this because having the poison value be all ones allows us to use the same -// value below. And the goal is just for the loaded bits to not be exposed to -// execution and coercing them to one is sufficient. +/// Harden a load by hardening the loaded value in the defined register. +/// +/// We can harden a non-leaking load into a register without touching the +/// address by just hiding all of the loaded bits during misspeculation. We use +/// an `or` instruction to do this because we set up our poison value as all +/// ones. And the goal is just for the loaded bits to not be exposed to +/// execution and coercing them to one is sufficient. void X86SpeculativeLoadHardeningPass::hardenPostLoad(MachineInstr &MI) { MachineBasicBlock &MBB = *MI.getParent(); DebugLoc Loc = MI.getDebugLoc(); |

