Fix data race in X86FloatingPoint.cpp ASSERT_SORTED

Summary:
ASSERT_SORTED checks if a table is sorted, and uses a boolean to
prevent the check from being run again if it was earlier determined
that the table is in fact sorted. Unsynchronized reads and writes of
that boolean triggered ThreadSanitizer's data race detection. This
change rewrites the code to use std::atomic<bool> instead.

Fixes PR36922.

Reviewers: rnk

Reviewed By: rnk

Subscribers: llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D45742

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330301 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed