The initialization of RegisterBank needs to be done only once. The
logic of AlreadyInit has a data race, use llvm::call_once instead.
This issue was identified through thread sanitizer.
Paths
| Differential D73587
[AArch64] Fix data race on RegisterBank initialization. ClosedPublic Authored by huihuiz on Jan 28 2020, 2:56 PM.
Details Summary The initialization of RegisterBank needs to be done only once. The This issue was identified through thread sanitizer.
Diff Detail
Event TimelineComment Actions This issue was exposed when linking with ThinLTO+lld, using a compiler built with thread sanitizer enabled. Comment Actions Using std::call_once, instead of a separate flag+mutex, would be a little more readable and efficient. This revision is now accepted and ready to land.Jan 28 2020, 6:08 PM Closed by commit rGa5a4a47d6914: [AArch64] Fix data race on RegisterBank initialization. (authored by huihuiz). · Explain WhyJan 29 2020, 10:17 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 241210 llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
|