Commit 233a54a
authored
fix: LLVM_Util::supports_isa is not thread-safe (#2029)
The supports_isa() function might be called from threads, and prior
to this change it might have added entries to the global sCpuFeatures
variable. This happened when detect_cpu_features() is called with
TargetISA::UNKNOWN and the code was looking for the best ISA. This
could lead to situation when the host CPU is ARM, and the probing
happens for AVX512.
This change ensures that the supports_isa() accesses sCpuFeatures
in the read-only manner.
This was originally noticed as unreliable OSL render tests in Blender
reported at https://projects.blender.org/blender/blender/issues/147642
Signed-off-by: Sergey Sharybin <[email protected]>1 parent 7c77f05 commit 233a54a
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1443 | 1443 | | |
1444 | 1444 | | |
1445 | 1445 | | |
1446 | | - | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
1447 | 1456 | | |
1448 | 1457 | | |
1449 | 1458 | | |
| |||
0 commit comments