summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86EvexToVex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/X86/X86EvexToVex.cpp')
-rw-r--r--llvm/lib/Target/X86/X86EvexToVex.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86EvexToVex.cpp b/llvm/lib/Target/X86/X86EvexToVex.cpp
index fb7217b2851..8352ebc037e 100644
--- a/llvm/lib/Target/X86/X86EvexToVex.cpp
+++ b/llvm/lib/Target/X86/X86EvexToVex.cpp
@@ -239,15 +239,15 @@ bool EvexToVexInstPass::CompressEvexToVexImpl(MachineInstr &MI) const {
#ifndef NDEBUG
// Make sure the tables are sorted.
- static bool TableChecked = false;
- if (!TableChecked) {
+ static std::atomic<bool> TableChecked(false);
+ if (!TableChecked.load(std::memory_order_relaxed)) {
assert(std::is_sorted(std::begin(X86EvexToVex128CompressTable),
std::end(X86EvexToVex128CompressTable)) &&
"X86EvexToVex128CompressTable is not sorted!");
assert(std::is_sorted(std::begin(X86EvexToVex256CompressTable),
std::end(X86EvexToVex256CompressTable)) &&
"X86EvexToVex256CompressTable is not sorted!");
- TableChecked = true;
+ TablesChecked.store(true, std::memory_order_relaxed);
}
#endif
OpenPOWER on IntegriCloud