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.
Differential D73587
[AArch64] Fix data race on RegisterBank initialization. huihuiz on Jan 28 2020, 2:56 PM. Authored by
Details 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. |