diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2018-07-14 09:32:37 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2018-07-14 09:32:37 +0000 |
commit | fb503ac0277ab6613d96c35f0eb6f789e585d3df (patch) | |
tree | f00c658efd574e1708029161ed152460cb6cf289 /llvm/lib | |
parent | 7426cf6717c341717f852142d8d11e81f0d67590 (diff) | |
download | bcm5719-llvm-fb503ac0277ab6613d96c35f0eb6f789e585d3df.tar.gz bcm5719-llvm-fb503ac0277ab6613d96c35f0eb6f789e585d3df.zip |
[x86/SLH] Fix an issue where we wouldn't harden any loads if we found
no conditions.
This is only valid to do if we're hardening calls and rets with LFENCE
which results in an LFENCE guarding the entire entry block for us.
llvm-svn: 337089
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp b/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp index 2bbb187b293..f5933cbc8ca 100644 --- a/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp +++ b/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp @@ -367,9 +367,9 @@ bool X86SpeculativeLoadHardeningPass::runOnMachineFunction( ++NumLFENCEsInserted; } - // If we have no conditionals to protect in blocks, then all we needed to do - // was protect the entry and so we're done. - if (Infos.empty()) + // If we guarded the entry with an LFENCE and have no conditionals to protect + // in blocks, then we're done. + if (FenceCallAndRet && Infos.empty()) // We may have changed the function's code at this point to insert fences. return true; |