OSDN Git Service

[x86/SLH] Remove complex SHRX-based post-load hardening.
authorChandler Carruth <chandlerc@gmail.com>
Tue, 24 Jul 2018 00:21:59 +0000 (00:21 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 24 Jul 2018 00:21:59 +0000 (00:21 +0000)
commit3813cf4b746a4e60025b8a85934288b3d1e24e79
treed7a327b6466fead204f54c73a8fc7982db689a2a
parent6ee94ea43df272c9999cccfb353f26723b07d53b
[x86/SLH] Remove complex SHRX-based post-load hardening.

This code was really nasty, had several bugs in it originally, and
wasn't carrying its weight. While on Zen we have all 4 ports available
for SHRX, on all of the Intel parts with Agner's tables, SHRX can only
execute on 2 ports, giving it 1/2 the throughput of OR.

Worse, all too often this pattern required two SHRX instructions in
a chain, hurting the critical path by a lot.

Even if we end up needing to safe/restore EFLAGS, that is no longer so
bad. We pay for a uop to save the flag, but we very likely get fusion
when it is used by forming a test/jCC pair or something similar. In
practice, I don't expect the SHRX to be a significant savings here, so
I'd like to avoid the complex code required. We can always resurrect
this if/when someone has a specific performance issue addressed by it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337781 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86SpeculativeLoadHardening.cpp