You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LLVMGetOrdering currently does not support fence instructions
LLVMIsAtomicSingleThread currently does not support fence or load/store instructions
In both cases, we will cast the unsupported instruction types to an unrelated type (whatever the else branch assumes it is), which will result in reading garbage. This will crash if assertions are enabled, otherwise it will just return whatever value it gets: in the case of LLVMGetOrdering this can return invalid enum values
The text was updated successfully, but these errors were encountered:
… instrs (#65228)
Fixes#65227
LLVMGetOrdering previously did not support Fence instructions, and
calling it on a fence would lead to a bad cast as it
assumed a load/store, or an AtomicRMWInst. This would either read a
garbage memory order, or assertion
LLVMIsAtomicSingleThread did not support either Fence instructions,
loads, or stores, and would similarly lead to a bad cast.
It happened to work out since the relevant types all have their synch
scope ID at the same offset, but it still should be fixed
These cases are now fixed for the C API, and tests for these
instructions are added. The echo test utility now also supports cloning
Fence instructions, which it did not previously
-----
From what I can tell, there's no unified API to pull
`getOrdering`/`getSyncScopeID` from, and instead requires casting to
individual types: if there is a better way of handling this I can switch
to that
Two related issues with atomics in the C API:
LLVMGetOrdering
currently does not support fence instructionsLLVMIsAtomicSingleThread
currently does not support fence or load/store instructionsIn both cases, we will cast the unsupported instruction types to an unrelated type (whatever the else branch assumes it is), which will result in reading garbage. This will crash if assertions are enabled, otherwise it will just return whatever value it gets: in the case of
LLVMGetOrdering
this can return invalid enum valuesThe text was updated successfully, but these errors were encountered: