[PATCH] D44824: [Spectre] Introduce a new pass to do speculative load hardening to mitigate Spectre variant #1 for x86.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 11 16:50:31 PDT 2018


chandlerc updated this revision to Diff 155085.
chandlerc added a comment.

Update with several bug fixes:

- No longer reversing the operands to SHRX instructions in two places.
- Correctly doing the PHI placement for the predicate state after we finish doing all the per-block rewrites so that we include the predicate state round trips through function calls.
- Fixing a nasty bug in EFLAGS copy lowering where we broke out of the loop too soon. I'll create a separate patch to land this with its own test, but included here so that this can be tested. It's just one line.

Also two generic improvements:

- Now that we're scanning more blocks in the EFLAGS copy lowering, improve how to detect non-dominating blocks. We can check before adding them rather than when we start visiting them which seems much more clear and simplifies the condition.
- Sink the initial predicate state formation past any label fluff at the top of the function. This may not be necessary but seemed like a nice clarification to me.


Repository:
  rL LLVM

https://reviews.llvm.org/D44824

Files:
  llvm/docs/SpeculativeLoadHardening.md
  llvm/docs/speculative_load_hardening_microbenchmarks.png
  llvm/include/llvm/CodeGen/MachineBasicBlock.h
  llvm/lib/CodeGen/MachineBasicBlock.cpp
  llvm/lib/CodeGen/RegisterCoalescer.cpp
  llvm/lib/Target/X86/CMakeLists.txt
  llvm/lib/Target/X86/LLVMBuild.txt
  llvm/lib/Target/X86/X86.h
  llvm/lib/Target/X86/X86FlagsCopyLowering.cpp
  llvm/lib/Target/X86/X86InstrInfo.h
  llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/test/CodeGen/X86/speculative-load-hardening.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44824.155085.patch
Type: text/x-patch
Size: 139850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180711/ba5b4d1d/attachment-0001.bin>


More information about the llvm-commits mailing list