summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86InstrInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/X86/X86InstrInfo.cpp')
-rw-r--r--llvm/lib/Target/X86/X86InstrInfo.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index 7096e8284ed..7492de27e7b 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -5413,7 +5413,8 @@ X86InstrInfo::X86InstrInfo(X86Subtarget &STI)
#ifndef NDEBUG
// Make sure the tables are sorted.
- static bool LLVM_ATTRIBUTE_UNUSED FoldTablesChecked = [] {
+ static std::atomic<bool> FoldTablesChecked(false);
+ if (!FoldTablesChecked.load(std::memory_order_relaxed)) {
assert(std::is_sorted(std::begin(MemoryFoldTable2Addr),
std::end(MemoryFoldTable2Addr)) &&
std::adjacent_find(std::begin(MemoryFoldTable2Addr),
@@ -5450,8 +5451,8 @@ X86InstrInfo::X86InstrInfo(X86Subtarget &STI)
std::end(MemoryFoldTable4)) ==
std::end(MemoryFoldTable4) &&
"MemoryFoldTable4 is not sorted and unique!");
- return true;
- }();
+ FoldTablesChecked.store(true, std::memory_order_relaxed);
+ }
#endif
}
OpenPOWER on IntegriCloud